]> asedeno.scripts.mit.edu Git - linux.git/commit
ceph: return -ERANGE if virtual xattr value didn't fit in buffer
authorJeff Layton <jlayton@kernel.org>
Thu, 13 Jun 2019 19:17:00 +0000 (15:17 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 8 Jul 2019 12:01:44 +0000 (14:01 +0200)
commit3b421018f48c482bdc9650f894aa1747cf90e51d
tree5876e406d919d5512256b4d5fe05d67d2074e2a6
parentf1d1b51deabbd1e7b8c24883145fbf784784d250
ceph: return -ERANGE if virtual xattr value didn't fit in buffer

The getxattr manpage states that we should return ERANGE if the
destination buffer size is too small to hold the value.
ceph_vxattrcb_layout does this internally, but we should be doing
this for all vxattrs.

Fix the only caller of getxattr_cb to check the returned size
against the buffer length and return -ERANGE if it doesn't fit.
Drop the same check in ceph_vxattrcb_layout and just rely on the
caller to handle it.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Acked-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/xattr.c