]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mds: prevent clients from exceeding the xattrs key/value limits
authorLuís Henriques <lhenriques@suse.de>
Wed, 1 Jun 2022 16:05:39 +0000 (17:05 +0100)
committerMykola Golub <mgolub@suse.com>
Fri, 3 Nov 2023 16:32:57 +0000 (18:32 +0200)
commitd3fc3487ab93087ba0dd3191df9a0d1e28091be4
tree7bb4e02bded698078bd027aff2c9a4cc301668b9
parentfa30f894de4376916bde9c19dba476b80c057930
mds: prevent clients from exceeding the xattrs key/value limits

Commit eb915d0eeccb ("cephfs: fix write_buf's _len overflow problem") added
a limit to the total size of xattrs.  This limit is respected by clients
doing a "sync" operation, i.e. MDS_OP_SETXATTR.  However, clients with
CAP_XATTR_EXCL can still buffer these operations and ignore these limits.

This patch prevents clients from crashing the MDSs by also imposing the
xattr limits even when they have the Xx caps.  Replaces the per-MDS knob
"max_xattr_pairs_size" by the new mdsmap setting that the clients can
access.

Unfortunately, clients that misbehave, i.e. old clients that don't respect
this xattrs limit and buffer their xattrs, will see them vanishing.

URL: https://tracker.ceph.com/issues/55725
Signed-off-by: Luís Henriques <lhenriques@suse.de>
(cherry picked from commit 13e07ff3e9540728857e98e952e61ed03036ac93)

Conflicts:
    src/mds/Server.cc (tweak in handle_client_readdir_snapdiff after
                       2ed401bbafb183924b28ea8fec275a8677a83426 merged)
src/common/options/mds.yaml.in
src/mds/Locker.cc
src/mds/Locker.h
src/mds/Server.cc