All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Walker <awalker@ixsystems.com>
To: linux-cifs@vger.kernel.org
Subject: Nested NTFS volumes within Windows SMB share may result in inode collisions in linux client
Date: Wed, 1 Mar 2023 17:07:17 -0500	[thread overview]
Message-ID: <CAB5c7xoUXH6Xy+79Wz8M4yC70E=rwUL0ZRD_ApAFWv=C7S_uxg@mail.gmail.com> (raw)

On my Windows server I mounted multiple NTFS volumes within the same
share and played around until I was able to create directories with
the same fileid number.

 ```
PS C:\SHARE> fsutil file queryFileID SUBDS/foo
File ID is 0x00000000000000000001000000000026
PS C:\SHARE> fsutil file queryFileID .\SUBDS3\TESTFOLDER\
File ID is 0x00000000000000000001000000000026
```
The Linux SMB client then grants these two directories the same devid
/ inode pair.

```
root@truenas[/tmpcifs]# stat SUBDS/foo
  File: SUBDS/foo
  Size: 0         Blocks: 0          IO Block: 1048576 directory
Device: 5eh/94d Inode: 281474976710694  Links: 2
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2023-03-01 13:13:42.425159200 -0800
Modify: 2023-03-01 13:13:42.425159200 -0800
Change: 2023-03-01 13:13:42.425159200 -0800
 Birth: 2023-02-22 10:49:37.331907600 -0800

root@truenas[/tmpcifs]# stat SUBDS3/TESTFOLDER
  File: SUBDS3/TESTFOLDER
  Size: 0         Blocks: 0          IO Block: 1048576 directory
Device: 5eh/94d Inode: 281474976710694  Links: 2
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2023-03-01 12:25:56.283589300 -0800
Modify: 2023-03-01 12:25:56.268165700 -0800
Change: 2023-03-01 12:25:56.268165700 -0800
 Birth: 2023-03-01 11:48:09.617084100 -0800
```

Windows identifies mounted volumes via reparse point:
https://learn.microsoft.com/en-us/windows/win32/fileio/determining-whether-a-directory-is-a-volume-mount-point

This is also clearly visible in packet captures.

Andrew

             reply	other threads:[~2023-03-01 22:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-01 22:07 Andrew Walker [this message]
2023-03-01 22:37 ` Nested NTFS volumes within Windows SMB share may result in inode collisions in linux client Paulo Alcantara
2023-03-02  1:33   ` Andrew Walker
2023-03-02  1:49     ` Steve French
2023-03-02  4:12       ` Andrew Walker
2023-03-02 19:18       ` Tom Talpey
2023-03-02 19:23         ` Steve French
2023-03-02 19:32           ` Tom Talpey
2023-03-02 19:38             ` Andrew Walker
2023-03-02 19:42           ` ronnie sahlberg
2023-03-02 18:00     ` Paulo Alcantara
2023-08-21 18:57 ` Paulo Alcantara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAB5c7xoUXH6Xy+79Wz8M4yC70E=rwUL0ZRD_ApAFWv=C7S_uxg@mail.gmail.com' \
    --to=awalker@ixsystems.com \
    --cc=linux-cifs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.