summaryrefslogtreecommitdiff
path: root/fs/smb/client/inode.c
diff options
context:
space:
mode:
authorSteve French <stfrench@microsoft.com>2023-10-20 07:01:49 +0300
committerSteve French <stfrench@microsoft.com>2023-10-31 20:23:11 +0300
commit72bc63f5e23a38b65ff2a201bdc11401d4223fa9 (patch)
tree3b8a8201e71711667ae74744cfbd8d8ba3bc84a6 /fs/smb/client/inode.c
parent7588b83066db9b9dc10c1a43b8e52a028ad327d2 (diff)
downloadlinux-72bc63f5e23a38b65ff2a201bdc11401d4223fa9.tar.xz
smb3: fix creating FIFOs when mounting with "sfu" mount option
Fixes some xfstests including generic/564 and generic/157 The "sfu" mount option can be useful for creating special files (character and block devices in particular) but could not create FIFOs. It did recognize existing empty files with the "system" attribute flag as FIFOs but this is too general, so to support creating FIFOs more safely use a new tag (but the same length as those for char and block devices ie "IntxLNK" and "IntxBLK") "LnxFIFO" to indicate that the file should be treated as a FIFO (when mounted with the "sfu"). For some additional context note that "sfu" followed the way that "Services for Unix" on Windows handled these special files (at least for character and block devices and symlinks), which is different than newer Windows which can handle special files as reparse points (which isn't an option to many servers). Cc: stable@vger.kernel.org Reviewed-by: Paulo Alcantara (SUSE) <pc@manguebit.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client/inode.c')
-rw-r--r--fs/smb/client/inode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c
index d7c302442c1e..c03a286ed418 100644
--- a/fs/smb/client/inode.c
+++ b/fs/smb/client/inode.c
@@ -592,6 +592,10 @@ cifs_sfu_type(struct cifs_fattr *fattr, const char *path,
cifs_dbg(FYI, "Symlink\n");
fattr->cf_mode |= S_IFLNK;
fattr->cf_dtype = DT_LNK;
+ } else if (memcmp("LnxFIFO", pbuf, 8) == 0) {
+ cifs_dbg(FYI, "FIFO\n");
+ fattr->cf_mode |= S_IFIFO;
+ fattr->cf_dtype = DT_FIFO;
} else {
fattr->cf_mode |= S_IFREG; /* file? */
fattr->cf_dtype = DT_REG;