From: Tom Talpey <tom@talpey.com>
To: Shyam Prasad N <nspmangalore@gmail.com>, Ralph Boehme <slow@samba.org>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
CIFS <linux-cifs@vger.kernel.org>,
linux-nfs@vger.kernel.org
Subject: Re: "Intent" of VFS lookups
Date: Fri, 24 Apr 2026 09:41:03 -0400 [thread overview]
Message-ID: <e248f3de-bbaf-48e3-9e86-0beb9a789556@talpey.com> (raw)
In-Reply-To: <CANT5p=ortwT7ensa+kKoCa=wMnGETpqaQuBnhDWMSNu82KsqFg@mail.gmail.com>
On 4/24/2026 9:20 AM, Shyam Prasad N wrote:
> On Thu, Apr 23, 2026 at 11:13 PM Ralph Boehme <slow@samba.org> wrote:
>>
>> On 4/23/26 7:01 PM, Shyam Prasad N wrote:
>>> Wanted to understand if this is a problem for other filesystems or if
>>> it is specific to SMB protocol?
>>> SMB2+ protocol mandate that open call specifies if the file being
>>> opened is a directory or not (regular file).
>> sure? From memory (though the logic has always kind of escaped me) if
>> you neither specify FILE_DIRECTORY_FILE nor FILE_NON_DIRECTORY_FILE the
>> server is supposed to open the object regardless of the type.
>
> Hi Ralph,
>
> That's interesting. The spec does not seem to define this. Perhaps purposely?
> Will try and prototype a change to verify.
This would be filesystem behavior and therefore it would be in MS-FSA,
not in the SMB2/3 protocol.
MS-FSA does indeed specify that in certain conditions, an open must
succeed on a directory even if both DIRECTORY_FILE and NON_DIRECTORY_FILE
are false (page 60 section 2.1.5.1):
If CreateOptions.FILE_DIRECTORY_FILE is TRUE then StreamTypeToOpen =
DirectoryStream.
Else if StreamTypeNameToOpen is "$INDEX_ALLOCATION" then
StreamTypeToOpen =
DirectoryStream.
Else if CreateOptions.FILE_NON_DIRECTORY_FILE is FALSE,
StreamNameToOpen is
empty, StreamTypeNameToOpen is empty, Open.File is not NULL, and
Open.File.FileType is
DirectoryFile then StreamTypeToOpen = DirectoryStream.
Else StreamTypeToOpen = DataStream
There are a bunch of other cases involving trailing separators, etc.
MS-FSA is, of course, not the only filesystem type which can be
exported by SMB.
Tom.
next prev parent reply other threads:[~2026-04-24 13:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-23 17:01 "Intent" of VFS lookups Shyam Prasad N
2026-04-23 17:43 ` Ralph Boehme
2026-04-24 13:20 ` Shyam Prasad N
2026-04-24 13:41 ` Tom Talpey [this message]
2026-04-28 16:12 ` Shyam Prasad N
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=e248f3de-bbaf-48e3-9e86-0beb9a789556@talpey.com \
--to=tom@talpey.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=nspmangalore@gmail.com \
--cc=slow@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).