diff options
| author | Pali Rohár <pali@kernel.org> | 2024-10-19 13:34:18 +0200 |
|---|---|---|
| committer | Steve French <stfrench@microsoft.com> | 2025-03-26 14:50:37 -0500 |
| commit | 6c06be908ca190e2d8feae1cf452d78598cd0b94 (patch) | |
| tree | efd919e8d0b30b3ebb584b13d64e05568b0789e3 /fs/smb/client/smb2ops.c | |
| parent | 5eeebd995836337afdf0c10c7439384d9f00de8d (diff) | |
cifs: Check if server supports reparse points before using them
Do not attempt to query or create reparse point when server fs does not
support it. This will prevent creating unusable empty object on the server.
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client/smb2ops.c')
| -rw-r--r-- | fs/smb/client/smb2ops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index 6958825431af..a700e5921961 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -5229,7 +5229,7 @@ static int smb2_make_node(unsigned int xid, struct inode *inode, const char *full_path, umode_t mode, dev_t dev) { struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); - int rc; + int rc = -EOPNOTSUPP; /* * Check if mounted with mount parm 'sfu' mount parm. @@ -5240,7 +5240,7 @@ static int smb2_make_node(unsigned int xid, struct inode *inode, if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) { rc = cifs_sfu_make_node(xid, inode, dentry, tcon, full_path, mode, dev); - } else { + } else if (le32_to_cpu(tcon->fsAttrInfo.Attributes) & FILE_SUPPORTS_REPARSE_POINTS) { rc = smb2_mknod_reparse(xid, inode, dentry, tcon, full_path, mode, dev); } |
