diff options
author | Yan, Zheng <zyan@redhat.com> | 2018-05-26 16:54:39 +0800 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2018-06-04 20:46:01 +0200 |
commit | aae1a442f8eac6d5442ee479df66d278c73a6ecc (patch) | |
tree | d4ae90203ef97bd7c60530264f7a58783f8d0e9c /fs/ceph | |
parent | fa466743a9fc6e4a24ef22285fb384f9ef4a2edb (diff) | |
download | linux-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.c | 3 |
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; |