cephfs allows dynamically changing(increase or decrease) maximum file size (sb->s_maxbytes). So in some cases(e.g. decrease s_maxbytes to a relatively small size), the size of existing file may become larger than current sb->s_maxbytes, in this case, blocking exceeded data range will cause file incomplete. This patch series tries to fix the issue by comparing real file size and max file size limit, and in order to not bother to VFS and other specific filesystems we just simply set sb->s_maxbytes to MAX_LFS_FILESIZE so that we can pass all checks in VFS successfully. We add new field max_file_size in struct ceph_fs_client to store max file size limit and doing additional proper checks based on it in cephfs code. Chengguang Xu (5): ceph: add new field max_file_size in ceph_fs_client ceph: add additional range check in ceph_fallocate() ceph: add additional offset check in ceph_write_iter() ceph: add additional offset check in ceph_read_iter() ceph: compare fsc->max_file_size and inode->i_size for max file size limit fs/ceph/file.c | 40 ++++++++++++++++++++++++++++++++-------- fs/ceph/mds_client.c | 3 ++- fs/ceph/super.c | 3 ++- fs/ceph/super.h | 1 + 4 files changed, 37 insertions(+), 10 deletions(-) -- 2.17.1 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html