mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
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 <pali@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
88cae132dc
commit
92210ccd87
|
|
@ -876,6 +876,11 @@ cifs_mkdir_setinfo(struct inode *inode, const char *full_path,
|
||||||
info.Attributes = cpu_to_le32(dosattrs);
|
info.Attributes = cpu_to_le32(dosattrs);
|
||||||
rc = CIFSSMBSetPathInfo(xid, tcon, full_path, &info, cifs_sb->local_nls,
|
rc = CIFSSMBSetPathInfo(xid, tcon, full_path, &info, cifs_sb->local_nls,
|
||||||
cifs_sb);
|
cifs_sb);
|
||||||
|
if (rc == -EOPNOTSUPP || rc == -EINVAL)
|
||||||
|
rc = SMBSetInformation(xid, tcon, full_path,
|
||||||
|
info.Attributes,
|
||||||
|
0 /* do not change write time */,
|
||||||
|
cifs_sb->local_nls, cifs_sb);
|
||||||
if (rc == 0)
|
if (rc == 0)
|
||||||
cifsInode->cifsAttrs = dosattrs;
|
cifsInode->cifsAttrs = dosattrs;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user