Skip to content

Commit 92210cc

Browse files
palismfrench
authored andcommitted
cifs: Add fallback code path for cifs_mkdir_setinfo()
Use SMBSetInformation() as a fallback function (when CIFSSMBSetPathInfo() fails) which can set attribudes on the directory, including changing read-only attribute. Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 88cae13 commit 92210cc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/smb/client/smb1ops.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,11 @@ cifs_mkdir_setinfo(struct inode *inode, const char *full_path,
876876
info.Attributes = cpu_to_le32(dosattrs);
877877
rc = CIFSSMBSetPathInfo(xid, tcon, full_path, &info, cifs_sb->local_nls,
878878
cifs_sb);
879+
if (rc == -EOPNOTSUPP || rc == -EINVAL)
880+
rc = SMBSetInformation(xid, tcon, full_path,
881+
info.Attributes,
882+
0 /* do not change write time */,
883+
cifs_sb->local_nls, cifs_sb);
879884
if (rc == 0)
880885
cifsInode->cifsAttrs = dosattrs;
881886
}

0 commit comments

Comments
 (0)