OpenCloudOS-Kernel/fs/ceph
David Disseldorp 2b2abcac8c ceph: fix listxattr vxattr buffer length calculation
ceph_listxattr() incorrectly returns a length based on the static
ceph_vxattrs_name_size() value, which only takes into account whether
vxattrs are hidden, ignoring vxattr.exists_cb().

When filling the xattr buffer ceph_listxattr() checks VXATTR_FLAG_HIDDEN
and vxattr.exists_cb(). If both are false, we return an incorrect
(oversize) length.

Fix this behaviour by always calculating the vxattrs length at runtime,
taking both vxattr.hidden and vxattr.exists_cb() into account.

This bug is only exposed with the new "ceph.snap.btime" vxattr, as all
other vxattrs with a non-null exists_cb also carry VXATTR_FLAG_HIDDEN.

Signed-off-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2019-07-08 14:01:41 +02:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile ceph: quota: add initial infrastructure to support cephfs quotas 2018-04-02 11:17:51 +02:00
acl.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 173 2019-05-30 11:26:40 -07:00
addr.c ceph: use vmf_error() in ceph_filemap_fault() 2019-01-07 22:48:48 +01:00
cache.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 188 2019-05-30 11:29:21 -07:00
cache.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 188 2019-05-30 11:29:21 -07:00
caps.c ceph: fix error handling in ceph_get_caps() 2019-06-05 20:34:39 +02:00
ceph_frag.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
debugfs.c ceph: silence a checker warning in mdsc_show() 2019-07-08 14:01:40 +02:00
dir.c ceph: ensure d_name stability in ceph_dentry_hash() 2019-04-23 21:37:54 +02:00
export.c ceph: snapshot nfs re-export 2019-05-07 19:22:36 +02:00
file.c ceph: single workqueue for inode related works 2019-06-05 20:34:39 +02:00
inode.c ceph: carry snapshot creation time with inodes 2019-07-08 14:01:40 +02:00
ioctl.c libceph, ceph: move ceph_calc_file_object_mapping() to striper.c 2018-04-02 10:12:43 +02:00
ioctl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
locks.c ceph: remove duplicated filelock ref increase 2019-05-07 19:22:36 +02:00
mds_client.c ceph: carry snapshot creation time with inodes 2019-07-08 14:01:40 +02:00
mds_client.h ceph: carry snapshot creation time with inodes 2019-07-08 14:01:40 +02:00
mdsmap.c libceph: make ceph_pr_addr take an struct ceph_entity_addr pointer 2019-05-07 19:43:05 +02:00
quota.c ceph: avoid iput_final() while holding mutex or in dispatch thread 2019-06-05 20:34:39 +02:00
snap.c ceph: avoid iput_final() while holding mutex or in dispatch thread 2019-06-05 20:34:39 +02:00
strings.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
super.c ceph: single workqueue for inode related works 2019-06-05 20:34:39 +02:00
super.h ceph: carry snapshot creation time with inodes 2019-07-08 14:01:40 +02:00
xattr.c ceph: fix listxattr vxattr buffer length calculation 2019-07-08 14:01:41 +02:00