]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commit
ceph: prevent a client from exceeding the MDS maximum xattr size
authorLuís Henriques <lhenriques@suse.de>
Fri, 3 Jun 2022 13:29:09 +0000 (14:29 +0100)
committerXiubo Li <xiubli@redhat.com>
Mon, 6 Jun 2022 00:42:53 +0000 (08:42 +0800)
commitdea94541077519a9c62dba9f980b1509e5a52872
tree47de4810227e34f286cfd1a45ef62cf52c95431c
parentc8c74fdf650132fd2e277399d83c7f0f7df98a88
ceph: prevent a client from exceeding the MDS maximum xattr size

The MDS tries to enforce a limit on the total key/values in extended
attributes.  However, this limit is enforced only if doing a synchronous
operation (MDS_OP_SETXATTR) -- if we're buffering the xattrs, the MDS
doesn't have a chance to enforce these limits.

This patch adds support for decoding the xattrs maximum size setting that is
distributed in the mdsmap.  Then, when setting an xattr, the kernel client
will revert to do a synchronous operation if that maximum size is exceeded.

While there, fix a dout() that would trigger a printk warning:

[   98.718078] ------------[ cut here ]------------
[   98.719012] precision 65536 too large
[   98.719039] WARNING: CPU: 1 PID: 3755 at lib/vsprintf.c:2703 vsnprintf+0x5e3/0x600
...

URL: https://tracker.ceph.com/issues/55725
Signed-off-by: Luís Henriques <lhenriques@suse.de>
Signed-off-by: Xiubo Li <xiubli@redhat.com>
fs/ceph/mdsmap.c
fs/ceph/xattr.c
include/linux/ceph/mdsmap.h