Specifies the MS-FSA extensions for supporting POSIX compliant operating systems.
|
Date |
Protocol Revision |
Revision Class |
Downloads |
|---|---|---|---|
|
6/30/2026 |
1.0.0 |
Major |
|
Date |
Protocol Revision |
Revision Class |
Downloads |
|---|---|---|---|
|
8/13/2024 |
0.04 |
Minor |
The SMB3 POSIX Extensions are extensions to enable POSIX compliant operating systems to better interoperate with SMB3 servers and storage appliances. This document specified the extensions to the [MS-FSA] specification. Popular servers such as Samba, Windows Server and others support SMB3 by default. These extensions are already implemented in multiple clients and servers.
SupportsPosix: A boolean that is TRUE if the volume's filesystem supports POSIX semantics.
statvfs: POSIX struct statvfs filesystem metadata. The implementation may map any of the struct statvfs members to existing MS-FSA 2.1.1.1 "Per Volume" attributes.
stat: POSIX stat metadata:
st_ino: POSIX inode number
st_dev: POSIX device identifier
st_mode: POSIX file type and mode
IsPosix: A boolean that is TRUE if this open is a POSIX open.
Volume.SupportsPosix MUST be initialized in an implementation defined manner.
When processing the following condition from MS-FSA 2.1.4.2:
and the condition is TRUE, the object store MUST additionally check:
If ByteRangeLock.OwnerOpen.IsPosix is True, the lock is advisory and the object store MUST ignore this lock when determining if a range access conflicts with read or write operations.
The server provides the following additional parameters:
PosixSemantics: A boolean that is TRUE if the server is requesting an open with POSIX semantics.
If PosixSemantics is FALSE the remainder of this section MUST be skipped. Otherwise the below processing MUST be done in addition to the processing from MS-FSA.
Phase 8 -- Completion of open
Open.IsPosix MUST be set to TRUE.
If Open.IsPosix is FALSE, the remainder of this section MUST be skipped.
The condition:
If ((File.FileAttributes.FILE_ATTRIBUTE_READONLY || File.Volume.IsReadOnly) &&
CreateOptions.FILE_DELETE_ON_CLOSE), then return STATUS_CANNOT_DELETE.
MUST be changed to do the following:
If CreateOptions.FILE_DELETE_ON_CLOSE is FALSE, the remainder of this section MUST be skipped.
If File.Volume.IsReadOnly, return
STATUS_CANNOT_DELETE.
If Open.FileAttributes.FILE_ATTRIBUTE_READONLY is TRUE and not Open.GrantedAccess.FILE_WRITE_ATTRIBUTES and not AccessCheck(SecurityContext, File.SecurityDescriptor, FILE_WRITE_ATTRIBUTES):
STATUS_CANNOT_DELETE.Phase 3 - File Deletion:
Processing of the following condition:
If Open.Link.DeleteUsingPosixSemantics is FALSE:
- If Open.Link.IsDeleted is TRUE and there does not exist an ExistingOpen in
Open.File.OpenList that has ExistingOpen.Link equal to Open.Link:
MUST be changed to:
The algorithm uses the following local variables:
- A boolean initialized to FALSE: HavePosixOpen
- A boolean initialized to FALSE: HaveWindowsOpen
If Open.Link.DeleteUsingPosixSemantics is FALSE:
- If Open.Link.IsDeleted is TRUE:
- For each ExistingOpen in Open.File.OpenList that has
ExistingOpen.Link equal to Open.Link:
- If ExistingOpen.IsPosix is FALSE:
- Set HaveWindowsOpen to TRUE
- Else:
- Set HavePosixOpen to TRUE
- EndIf
- EndFor
- If HaveWindowsOpen is FALSE:
- Remove Open.Link from Open.File.LinkList
- Remove Open.Link from Open.Link.ParentFile.DirectoryList
- Set LinkDeleted to TRUE
- If Open.File.LinkList is empty:
- Set FileDeleted to TRUE
- EndIf
- If HavePosixOpen is TRUE:
- Add Open.Link to a list that is used to track deleted
files that are open
- EndIf
- EndIf
- EndIf
OutputBuffer is of type FILE_POSIX_INFORMATION as defined in POSIX-FSCC 2.2.1 "FilePosixInformation".
OutputBuffer is an array of one or more FILE_POSIX_INFORMATION structures as described in POSIX-FSCC 2.2.1 "FilePosixInformation". Entry is a parameter to this routine that points to the current FILE_POSIX_INFORMATION structure to fill out. Note that the FileName field is not set in this section.
Pseudocode for the operation is as follows:
If OutputBufferSize is smaller than FieldOffset(FILE_POSIX_INFORMATION.FileName), the operation MUST be failed with STATUS_INFO_LENGTH_MISMATCH.
The object store MUST process this query using the algorithm described in section MS_FSA 2.1.5.6.3 "Directory Information Queries".
Entry MUST be constructed as follows:
Entry.NextEntryOffset set to zero
The object store MUST set Entry.CreationTime to Open.File.CreationTime
The object store MUST set Entry.LastAccessTime to Open.File.LastAccessTime
The object store MUST set Entry.LastWriteTime to Open.File.LastModificationTime
The object store MUST set Entry.ChangeTime to Open.File.LastChangeTime
The object store MUST set Entry.EndOfFile to Open.Stream.Size
The object store MUST set Entry.AllocationSize to Open.Stream.AllocationSize
If Open.Stream.StreamType is DirectoryStream:
The object store MUST set Entry.FileAttributes equal to the value of Open.File.FileAttributes
The object store MUST set FILE_ATTRIBUTE_DIRECTORY in Entry.FileAttributes
Else:
This is a DataStream. The object store MUST set Entry.FileAttributes equal to the value of Open.File.FileAttributes. The following attribute values, if they are set in Open.File.FileAttributes, MUST NOT be copied to Entry.FileAttributes (attribute flags are defined in [MS-FSCC] section 2.6):
If Open.Stream.IsSparse is TRUE, the object store MUST set FILE_ATTRIBUTE_SPARSE_FILE in Entry.FileAttributes
If Open.Stream.IsEncrypted is TRUE, the object store MUST set FILE_ATTRIBUTE_ENCRYPTED in OuputBuffer.FileAttributes
If Open.Stream.IsCompressed is TRUE, the object store MUST set FILE_ATTRIBUTE_COMPRESSED in Entry.FileAttributes
If Open.Stream.ChecksumAlgorithm != CHECKSUM_TYPE_NONE, the object store MUST set FILE_ATTRIBUTE_INTEGRITY_STREAM in Entry.FileAttributes
EndIf
If Entry.FileAttributes is 0, the object store MUST set FILE_ATTRIBUTE_NORMAL in Entry.FileAttributes
The object store MUST set Entry.Inode to Open.File.stat.st_ino
The object store MUST set Entry.Device to Open.File.stat.st_dev
The object store MUST set Entry.Reserved to 0
The object store MUST set Entry.NumberOfLinks to the number of Links in Open.File.LinkList
The object store MUST set Entry.ReparseTag
The object store MUST set Entry.POSIXMode to a value computed from Open.File.stat.st_mode as specified in POSIX-FSCC 2.1.1
The object store MUST set Entry.OwnerSID to Open.File.SecurityDescriptor.OwnerSid
The object store MUST set Entry.GroupSID to Open.File.SecurityDescriptor.GroupSID
The object store MUST set Entry.FilenameLength to the length in bytes of Link.Name
If Open.IsPosix is False, the reminder of this section MUST be skipped.
Otherwise. the object store MUST process the lock request according to POSIX proposal "Open File Description Locks" (OFD) semantics:
A POSIX lock request for an overlapping range by the same owner MUST replace any existing POSIX locks in that range, allowing lock upgrade or downgrade. Existing locks are split or merged to accomodate lock up- and downgrade.
POSIX locks do not conflict with existing POSIX locks on the same Open.
POSIX unlock requests may unlock parts of locked ranges, thereby shrinking or splitting existing ranges.
If Open.IsPosix is False, the reminder of this section MUST be skipped.
Otherwise, the object store MUST process the unlock request according to POSIX semantics:
The unlock operation MUST unlock any range of POSIX locks in the specified range held by the same Open:
if a range is completely unlocked, the lock is removed,
if a range is partially matched, the existing lock is shrunk,
if the unlock range splits an existing POSIX lock into two disjoint ranges, the object store MUST split the lock into two separate POSIX locks.
OutputBuffer is of type FILE_POSIX_INFORMATION as defined in POSIX-FSCC 2.2.1 "FilePosixInformation".
Pseudocode for the operation is as follows:
If OutputBufferSize is smaller than BlockAlign(sizeof(FILE_POSIX_INFORMATION), 8), the operation MUST be failed with STATUS_INFO_LENGTH_MISMATCH
If Open.GrantedAccess does not contain FILE_READ_ATTRIBUTES, the operation MUST be failed with STATUS_ACCESS_DENIED
The object store MUST set OutputBuffer.CreationTime to Open.File.CreationTime
The object store MUST set OutputBuffer.LastAccessTime to Open.File.LastAccessTime
The object store MUST set OutputBuffer.LastWriteTime to Open.File.LastModificationTime
The object store MUST set OutputBuffer.ChangeTime to Open.File.LastChangeTime
The object store MUST set OutputBuffer.EndOfFile to Open.Stream.Size
The object store MUST set OutputBuffer.AllocationSize to Open.Stream.AllocationSize
If Open.Stream.StreamType is DirectoryStream:
The object store MUST set OutputBuffer.FileAttributes equal to the value of Open.File.FileAttributes
The object store MUST set FILE_ATTRIBUTE_DIRECTORY in OutputBuffer.FileAttributes
Else:
This is a DataStream. The object store MUST set OutputBuffer.FileAttributes equal to the value of Open.File.FileAttributes. The following attribute values, if they are set in Open.File.FileAttributes, MUST NOT be copied to OutputBuffer.FileAttributes (attribute flags are defined in [MS-FSCC] section 2.6):
If Open.Stream.IsSparse is TRUE, the object store MUST set FILE_ATTRIBUTE_SPARSE_FILE in OutputBuffer.FileAttributes
If Open.Stream.IsEncrypted is TRUE, the object store MUST set FILE_ATTRIBUTE_ENCRYPTED in OuputBuffer.FileAttributes
If Open.Stream.IsCompressed is TRUE, the object store MUST set FILE_ATTRIBUTE_COMPRESSED in OutputBuffer.FileAttributes
If Open.Stream.ChecksumAlgorithm != CHECKSUM_TYPE_NONE, the object store MUST set FILE_ATTRIBUTE_INTEGRITY_STREAM in OutputBuffer.FileAttributes
EndIf
If OutputBuffer.FileAttributes is 0, the object store MUST set FILE_ATTRIBUTE_NORMAL in OutputBuffer.FileAttributes
The object store MUST set OutputBuffer.Inode to Open.File.stat.st_ino
The object store MUST set OutputBuffer.Device to Open.File.stat.st_dev
The object store MUST set OutputBuffer.Reserved to 0.
The object store MUST set OutputBuffer.NumberOfLinks to the number of Links in Open.File.LinkList
The object store MUST set OutputBuffer.ReparseTag
The object store MUST set OutputBuffer.POSIXMode to a value computed from Open.File.stat.st_mode as specified in POSIX-FSCC 2.1.1
The object store MUST set OutputBuffer.OwnerSID to Open.File.SecurityDescriptor.OwnerSid
The object store MUST set OutputBuffer.GroupSID to Open.File.SecurityDescriptor.GroupSID
The object store MUST set OutputBuffer.Filename to BuildRelativeName(Open.Link, Open.File.Volume.RootDirectory)
The object store MUST set OutputBuffer.FilenameLength to the length in bytes of OutputBuffer.Filename
Upon successful completion of the operation, the object store MUST return:
ByteCount set to sizeof(FILE_POSIX_INFORMATION)
Status set to STATUS_SUCCESS
OutputBuffer is of type FILE_FS_POSIX_INFORMATION, as described in POSIX-FSCC 2.3.1.
Pseudocode for the operation is as follows:
OutputBuffer MUST be constructed as follows:
OutputBuffer.OptimalTransferSize set to Open.File.Volume.statvfs.f_bsize
OutputBuffer.BlockSize set to Open.File.Volume.statvfs.f_frsize
OutputBuffer.TotalBlocks set to Open.File.Volume.statvfs.f_blocks
OutputBuffer.BlocksAvailable set to Open.File.Volume.statvfs.f_bfree
OutputBuffer.UserBlocksAvailable set to Open.File.Volume.statvfs.f_bavail
OutputBuffer.TotalFileNodes set to Open.File.Volume.statvfs.f_files
OutputBuffer.FreeFileNodes set to Open.File.Volume.statvfs.f_ffree
OutputBuffer.FsIdentifier set to Open.File.Volume.statvfs.f_fsid
Upon successful completion of the operation, the object store MUST return:
ByteCount MUST be set to sizeof(FILE_FS_POSIX_INFORMATION)
Status set to STATUS_SUCCESS
If Open.IsPosix is FALSE, the remainder of this section MUST be skipped.
Otherwise, the server MUST replace the following check
If File.FileAttributes.FILE_ATTRIBUTE_READONLY is TRUE, the operation MUST
be failed with STATUS_CANNOT_DELETE.
with:
If Open.FileAttributes.FILE_ATTRIBUTE_READONLY is TRUE and Open.GrantedAccess does not incluce FILE_WRITE_ATTRIBUTES and not AccessCheck(SecurityContext, File.SecurityDescriptor, FILE_WRITE_ATTRIBUTES):
If Open.IsPosix is FALSE, the remainder of this section MUST be skipped.
Otherwise, the server MUST replace the following clause
- If File.FileAttributes.FILE_ATTRIBUTE_READONLY:
- If not InputBuffer.Flags.FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE or
not Open.GrantedAccess.FILE_WRITE_ATTRIBUTES:
- The operation MUST be failed with STATUS_CANNOT_DELETE.
with:
If Open.FileAttributes.FILE_ATTRIBUTE_READONLY is TRUE and Open.GrantedAccess does not incluce FILE_WRITE_ATTRIBUTES and not AccessCheck(SecurityContext, File.SecurityDescriptor, FILE_WRITE_ATTRIBUTES):