Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 518549c

Browse files
author
Steve French
committed
cifs: fix creating sockets when using sfu mount options
When running fstest generic/423 with sfu mount option, it was being skipped due to inability to create sockets: generic/423 [not run] cifs does not support mknod/mkfifo which can also be easily reproduced with their af_unix tool: ./src/af_unix /mnt1/socket-two bind: Operation not permitted Fix sfu mount option to allow creating and reporting sockets. Cc: stable@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 9ee267a commit 518549c

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

fs/smb/client/cifspdu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2574,7 +2574,7 @@ typedef struct {
25742574

25752575

25762576
struct win_dev {
2577-
unsigned char type[8]; /* IntxCHR or IntxBLK or LnxFIFO*/
2577+
unsigned char type[8]; /* IntxCHR or IntxBLK or LnxFIFO or LnxSOCK */
25782578
__le64 major;
25792579
__le64 minor;
25802580
} __attribute__((packed));

fs/smb/client/inode.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,10 @@ cifs_sfu_type(struct cifs_fattr *fattr, const char *path,
606606
mnr = le64_to_cpu(*(__le64 *)(pbuf+16));
607607
fattr->cf_rdev = MKDEV(mjr, mnr);
608608
}
609+
} else if (memcmp("LnxSOCK", pbuf, 8) == 0) {
610+
cifs_dbg(FYI, "Socket\n");
611+
fattr->cf_mode |= S_IFSOCK;
612+
fattr->cf_dtype = DT_SOCK;
609613
} else if (memcmp("IntxLNK", pbuf, 7) == 0) {
610614
cifs_dbg(FYI, "Symlink\n");
611615
fattr->cf_mode |= S_IFLNK;

fs/smb/client/smb2ops.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4997,6 +4997,9 @@ static int __cifs_sfu_make_node(unsigned int xid, struct inode *inode,
49974997
pdev.major = cpu_to_le64(MAJOR(dev));
49984998
pdev.minor = cpu_to_le64(MINOR(dev));
49994999
break;
5000+
case S_IFSOCK:
5001+
strscpy(pdev.type, "LnxSOCK");
5002+
break;
50005003
case S_IFIFO:
50015004
strscpy(pdev.type, "LnxFIFO");
50025005
break;

0 commit comments

Comments
 (0)