aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonnie Sahlberg <lsahlber@redhat.com>2019-02-07 15:48:44 +1000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-20 09:17:04 +0200
commitf0f1c97f38b890c5eea33dfd60fb2d12657ba0ef (patch)
tree8ea9be5b208791a72015649dd76ecbee520ab1f5
parent2fbb0171b13a2fcdd7deb682527784b47cd8d624 (diff)
downloadlinux-yocto-f0f1c97f38b890c5eea33dfd60fb2d12657ba0ef.tar.gz
linux-yocto-f0f1c97f38b890c5eea33dfd60fb2d12657ba0ef.tar.bz2
linux-yocto-f0f1c97f38b890c5eea33dfd60fb2d12657ba0ef.zip
cifs: return -ENODATA when deleting an xattr that does not exist
[ Upstream commit 2109464184919f81efd593b4008291448c522815 ] BUGZILLA: https://bugzilla.kernel.org/show_bug.cgi?id=202007 When deleting an xattr/EA: SMB2/3 servers will return SUCCESS when clients delete non-existing EAs. This means that we need to first QUERY the server and check if the EA exists or not so that we can return -ENODATA correctly when this happens. Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/cifs/smb2ops.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index b29f711ab965..ea56b1cdbdde 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -949,6 +949,16 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
resp_buftype[0] = resp_buftype[1] = resp_buftype[2] = CIFS_NO_BUFFER;
memset(rsp_iov, 0, sizeof(rsp_iov));
+ if (ses->server->ops->query_all_EAs) {
+ if (!ea_value) {
+ rc = ses->server->ops->query_all_EAs(xid, tcon, path,
+ ea_name, NULL, 0,
+ cifs_sb);
+ if (rc == -ENODATA)
+ goto sea_exit;
+ }
+ }
+
/* Open */
memset(&open_iov, 0, sizeof(open_iov));
rqst[0].rq_iov = open_iov;