summaryrefslogtreecommitdiffstats
path: root/fs/ceph/inode.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2018-05-26 10:54:39 +0200
committerIlya Dryomov <idryomov@gmail.com>2018-06-04 20:46:01 +0200
commitaae1a442f8eac6d5442ee479df66d278c73a6ecc (patch)
treed4ae90203ef97bd7c60530264f7a58783f8d0e9c /fs/ceph/inode.c
parentceph: fix wrong check for the case of updating link count (diff)
downloadlinux-aae1a442f8eac6d5442ee479df66d278c73a6ecc.tar.xz
linux-aae1a442f8eac6d5442ee479df66d278c73a6ecc.zip
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>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r--fs/ceph/inode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 4aeccb13437b..4fda7a9d4c9d 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;