aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorSteve French <smfrench@gmail.com>2014-02-02 00:27:18 -0500
committerSteve French <smfrench@gmail.com>2014-02-07 12:08:15 -0500
commitd979f3b0a1f0b5499ab85e68cdf02b56852918b6 (patch)
tree31e601bff6aab26a5453ae30bd2c1bf0c2554e28 /fs/cifs
parent9343224bfd4be6a02e6ae0c0d66426c955c7d76e (diff)
Add protocol specific operation for CIFS xattrs
Changeset 666753c3ef8fc88b0ddd5be4865d0aa66428ac35 added protocol operations for get/setxattr to avoid calling cifs operations on smb2/smb3 mounts for xattr operations and this changeset adds the calls to cifs specific protocol operations for xattrs (in order to reenable cifs support for xattrs which was temporarily disabled by the previous changeset. We do not have SMB2/SMB3 worker function for setting xattrs yet so this only enables it for cifs. CCing stable since without these two small changsets (its small coreq 666753c3ef8fc88b0ddd5be4865d0aa66428ac35 is also needed) calling getfattr/setfattr on smb2/smb3 mounts causes problems. Signed-off-by: Steve French <smfrench@gmail.com> Reviewed-by: Shirish Pargaonkar <spargaonkar@suse.com> CC: Stable <stable@kernel.org>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/inode.c13
-rw-r--r--fs/cifs/smb1ops.c4
2 files changed, 13 insertions, 4 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 9cb9679d7357..be58b8fcdb3c 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -527,10 +527,15 @@ static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path,
527 return PTR_ERR(tlink); 527 return PTR_ERR(tlink);
528 tcon = tlink_tcon(tlink); 528 tcon = tlink_tcon(tlink);
529 529
530 rc = CIFSSMBQAllEAs(xid, tcon, path, "SETFILEBITS", 530 if (tcon->ses->server->ops->query_all_EAs == NULL) {
531 ea_value, 4 /* size of buf */, cifs_sb->local_nls, 531 cifs_put_tlink(tlink);
532 cifs_sb->mnt_cifs_flags & 532 return -EOPNOTSUPP;
533 CIFS_MOUNT_MAP_SPECIAL_CHR); 533 }
534
535 rc = tcon->ses->server->ops->query_all_EAs(xid, tcon, path,
536 "SETFILEBITS", ea_value, 4 /* size of buf */,
537 cifs_sb->local_nls,
538 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
534 cifs_put_tlink(tlink); 539 cifs_put_tlink(tlink);
535 if (rc < 0) 540 if (rc < 0)
536 return (int)rc; 541 return (int)rc;
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index 9ac5bfc9cc56..3e4ff79e3031 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -1067,6 +1067,10 @@ struct smb_version_operations smb1_operations = {
1067 .query_mf_symlink = cifs_query_mf_symlink, 1067 .query_mf_symlink = cifs_query_mf_symlink,
1068 .create_mf_symlink = cifs_create_mf_symlink, 1068 .create_mf_symlink = cifs_create_mf_symlink,
1069 .is_read_op = cifs_is_read_op, 1069 .is_read_op = cifs_is_read_op,
1070#ifdef CONFIG_CIFS_XATTR
1071 .query_all_EAs = CIFSSMBQAllEAs,
1072 .set_EA = CIFSSMBSetEA,
1073#endif /* CIFS_XATTR */
1070}; 1074};
1071 1075
1072struct smb_version_values smb1_values = { 1076struct smb_version_values smb1_values = {