summaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorChengguang Xu2018-07-19 16:15:24 +0200
committerIlya Dryomov2018-08-02 21:33:27 +0200
commit719784ba706cdbb47ef87483950f0a4594d36e87 (patch)
tree98ebbab08cb3fda315435011ad517effcc08956e /fs/ceph/mds_client.c
parentlibceph: weaken sizeof check in ceph_x_verify_authorizer_reply() (diff)
downloadkernel-qcow2-linux-719784ba706cdbb47ef87483950f0a4594d36e87.tar.gz
kernel-qcow2-linux-719784ba706cdbb47ef87483950f0a4594d36e87.tar.xz
kernel-qcow2-linux-719784ba706cdbb47ef87483950f0a4594d36e87.zip
ceph: add new field max_file_size in ceph_fs_client
In order to not bother to VFS and other specific filesystems, we decided to do offset validation inside ceph kernel client, so just simply set sb->s_maxbytes to MAX_LFS_FILESIZE so that it can successfully pass VFS check. We add new field max_file_size in ceph_fs_client to store real file size limit and doing proper check based on it. Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Reviewed-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 4fc7582233db..dfbe138472e6 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -4018,7 +4018,8 @@ void ceph_mdsc_handle_mdsmap(struct ceph_mds_client *mdsc, struct ceph_msg *msg)
} else {
mdsc->mdsmap = newmap; /* first mds map */
}
- mdsc->fsc->sb->s_maxbytes = mdsc->mdsmap->m_max_file_size;
+ mdsc->fsc->max_file_size = min((loff_t)mdsc->mdsmap->m_max_file_size,
+ MAX_LFS_FILESIZE);
__wake_requests(mdsc, &mdsc->waiting_for_map);
ceph_monc_got_map(&mdsc->fsc->client->monc, CEPH_SUB_MDSMAP,