Skip to content

Commit aae1a44

Browse files
ukernelidryomov
authored andcommitted
ceph: prevent i_version from going back
inode info from non-auth can be stale. Signed-off-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
1 parent fa46674 commit aae1a44

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/ceph/inode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,8 @@ static int fill_inode(struct inode *inode, struct page *locked_page,
889889
}
890890

891891
/* finally update i_version */
892-
ci->i_version = le64_to_cpu(info->version);
892+
if (le64_to_cpu(info->version) > ci->i_version)
893+
ci->i_version = le64_to_cpu(info->version);
893894

894895
inode->i_mapping->a_ops = &ceph_aops;
895896

0 commit comments

Comments
 (0)