When remove a non-existent EA, the cifs return successfully. # mount //localhost/cifs cifs -o user=root,password=redhat # touch cifs/file # setfattr -x user.test cifs/file # echo $? 0 It should be like this. # touch file # setfattr -x user.test file setfattr: file: No such attribute # echo $? 1
The problem is that we do not check if the attribute exists before we try to delete it. If we delete an attribute using SMB2 SET_INFO the server will return STATUS_SUCCESS even if the attribute did not exist. What we need to do here is to first check if the attribute exists in cifs.ko before we decide if we should try to delete it.
Fixed in commit 2109464184919f81efd593b4008291448c522815 Author: Ronnie Sahlberg <lsahlber@redhat.com> Date: Thu Feb 7 15:48:44 2019 +1000 cifs: return -ENODATA when deleting an xattr that does not exist 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>