Skip to content

Commit 155de79

Browse files
committed
ceph: switch to corrected encoding of max_xattr_size in mdsmap
jira LE-1907 Rebuild_History Non-Buildable kernel-5.14.0-427.40.1.el9_4 commit-author Xiubo Li <xiubli@redhat.com> commit 51d3114 The addition of bal_rank_mask with encoding version 17 was merged into ceph.git in Oct 2022 and made it into v18.2.0 release normally. A few months later, the much delayed addition of max_xattr_size got merged, also with encoding version 17, placed before bal_rank_mask in the encoding -- but it didn't make v18.2.0 release. The way this ended up being resolved on the MDS side is that bal_rank_mask will continue to be encoded in version 17 while max_xattr_size is now encoded in version 18. This does mean that older kernels will misdecode version 17, but this is also true for v18.2.0 and v18.2.1 clients in userspace. The best we can do is backport this adjustment -- see ceph.git commit 78abfeaff27fee343fb664db633de5b221699a73 for details. [ idryomov: changelog ] Cc: stable@vger.kernel.org Link: https://tracker.ceph.com/issues/64440 Fixes: d93231a ("ceph: prevent a client from exceeding the MDS maximum xattr size") Signed-off-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Patrick Donnelly <pdonnell@ibm.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com> (cherry picked from commit 51d3114) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 8535733 commit 155de79

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

fs/ceph/mdsmap.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,11 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end, bool msgr2)
379379
ceph_decode_skip_8(p, end, bad_ext);
380380
/* required_client_features */
381381
ceph_decode_skip_set(p, end, 64, bad_ext);
382+
/* bal_rank_mask */
383+
ceph_decode_skip_string(p, end, bad_ext);
384+
}
385+
if (mdsmap_ev >= 18) {
382386
ceph_decode_64_safe(p, end, m->m_max_xattr_size, bad_ext);
383-
} else {
384-
/* This forces the usage of the (sync) SETXATTR Op */
385-
m->m_max_xattr_size = 0;
386387
}
387388
bad_ext:
388389
dout("mdsmap_decode m_enabled: %d, m_damaged: %d, m_num_laggy: %d\n",

include/linux/ceph/mdsmap.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ struct ceph_mdsmap {
2525
u32 m_session_timeout; /* seconds */
2626
u32 m_session_autoclose; /* seconds */
2727
u64 m_max_file_size;
28-
u64 m_max_xattr_size; /* maximum size for xattrs blob */
28+
/*
29+
* maximum size for xattrs blob.
30+
* Zeroed by default to force the usage of the (sync) SETXATTR Op.
31+
*/
32+
u64 m_max_xattr_size;
2933
u32 m_max_mds; /* expected up:active mds number */
3034
u32 m_num_active_mds; /* actual up:active mds number */
3135
u32 possible_max_rank; /* possible max rank index */

0 commit comments

Comments
 (0)