From: Yan, Zheng Date: Sat, 26 May 2018 08:54:39 +0000 (+0800) Subject: ceph: prevent i_version from going back X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=aae1a442f8eac6d5442ee479df66d278c73a6ecc;p=linux.git ceph: prevent i_version from going back inode info from non-auth can be stale. Signed-off-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov --- diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 4aeccb13437bd..4fda7a9d4c9d8 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -889,7 +889,8 @@ static int fill_inode(struct inode *inode, struct page *locked_page, } /* finally update i_version */ - ci->i_version = le64_to_cpu(info->version); + if (le64_to_cpu(info->version) > ci->i_version) + ci->i_version = le64_to_cpu(info->version); inode->i_mapping->a_ops = &ceph_aops;