ceph: add additional size check in ceph_setattr()
authorChengguang Xu <cgxu519@gmx.com>
Sun, 5 Aug 2018 11:33:01 +0000 (19:33 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 13 Aug 2018 15:55:43 +0000 (17:55 +0200)
commit36a4c72d1c6f5f50d4db14a38f296855ae82571b
tree0ba22abf9482dc9ad7abadd18f1b2b1ede2ff95a
parent8687a3e2c7a026c173ac2e0d65d869c98c154a3a
ceph: add additional size check in ceph_setattr()

ceph_setattr() finally calls vfs function inode_newsize_ok()
to do offset validation and that is based on sb->s_maxbytes.
Because we set sb->s_maxbytes to MAX_LFS_FILESIZE to through
VFS check and do proper offset validation in cephfs level,
we need adding proper offset validation before calling
inode_newsize_ok().

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/inode.c