smb3: fix caching of ctime on setxattr
authorSteve French <stfrench@microsoft.com>
Fri, 26 Jan 2024 06:01:37 +0000 (00:01 -0600)
committerSteve French <stfrench@microsoft.com>
Sat, 27 Jan 2024 06:15:50 +0000 (00:15 -0600)
Fixes xfstest generic/728 which had been failing due to incorrect
ctime after setxattr and removexattr

Update ctime on successful set of xattr

Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/xattr.c

index 998fa51f9b684c2ba919575ae93b3f51b13006d5..786b4f6e1263af3e08ddc5ce02c7ec9f8ac8e28c 100644 (file)
@@ -150,10 +150,13 @@ static int cifs_xattr_set(const struct xattr_handler *handler,
                if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
                        goto out;
 
-               if (pTcon->ses->server->ops->set_EA)
+               if (pTcon->ses->server->ops->set_EA) {
                        rc = pTcon->ses->server->ops->set_EA(xid, pTcon,
                                full_path, name, value, (__u16)size,
                                cifs_sb->local_nls, cifs_sb);
+                       if (rc == 0)
+                               inode_set_ctime_current(inode);
+               }
                break;
 
        case XATTR_CIFS_ACL: