summaryrefslogtreecommitdiff
path: root/fs/ceph
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2018-05-26 16:54:39 +0800
committerIlya Dryomov <idryomov@gmail.com>2018-06-04 20:46:01 +0200
commitaae1a442f8eac6d5442ee479df66d278c73a6ecc (patch)
treed4ae90203ef97bd7c60530264f7a58783f8d0e9c /fs/ceph
parentfa466743a9fc6e4a24ef22285fb384f9ef4a2edb (diff)
downloadlinux-aae1a442f8eac6d5442ee479df66d278c73a6ecc.tar.gz
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')
-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;