]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ceph: increment i_version when doing a setattr with caps
authorJeff Layton <jlayton@kernel.org>
Wed, 24 Aug 2022 13:24:42 +0000 (09:24 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 4 Oct 2022 17:18:08 +0000 (19:18 +0200)
When the client has enough caps to satisfy a setattr locally without
having to talk to the server, we currently do the setattr without
incrementing the change attribute.

Ensure that if the ctime changes locally, then the change attribute
does too.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/inode.c

index b4a3cb07d5b007063d96677c43d96dbc12715a11..a5e2eb5704c9f2f618103f58d1c7cdc9294321eb 100644 (file)
@@ -2192,6 +2192,7 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr)
                inode_dirty_flags = __ceph_mark_dirty_caps(ci, dirtied,
                                                           &prealloc_cf);
                inode->i_ctime = attr->ia_ctime;
+               inode_inc_iversion_raw(inode);
        }
 
        release &= issued;