aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2018-05-26 04:54:39 -0400
committerIlya Dryomov <idryomov@gmail.com>2018-06-04 14:46:01 -0400
commitaae1a442f8eac6d5442ee479df66d278c73a6ecc (patch)
treed4ae90203ef97bd7c60530264f7a58783f8d0e9c
parentfa466743a9fc6e4a24ef22285fb384f9ef4a2edb (diff)
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>
-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,
889 } 889 }
890 890
891 /* finally update i_version */ 891 /* 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);
893 894
894 inode->i_mapping->a_ops = &ceph_aops; 895 inode->i_mapping->a_ops = &ceph_aops;
895 896