From: "Luís Henriques" <lhenriques@suse.de>
To: "Xiubo Li" <xiubli@redhat.com>,
"Ilya Dryomov" <idryomov@gmail.com>,
"Jeff Layton" <jlayton@kernel.org>,
"Luís Henriques" <lhenriques@suse.de>
Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] ceph: fix mdsmap decode for v >= 17
Date: Thu, 27 Oct 2022 16:28:11 +0100 [thread overview]
Message-ID: <20221027152811.7603-1-lhenriques@suse.de> (raw)
Commit d93231a6bc8a ("ceph: prevent a client from exceeding the MDS
maximum xattr size") was merged before the corresponding MDS-side changes
have been merged. With the introduction of 'bal_rank_mask' in the mdsmap,
the decoding of maps with v>=17 is now incorrect. Fix this by skipping
the 'bal_rank_mask' string decoding.
Fixes: d93231a6bc8a ("ceph: prevent a client from exceeding the MDS maximum xattr size")
Signed-off-by: Luís Henriques <lhenriques@suse.de>
---
Hi!
This inconsistency was introduced by ceph PR #43284; I think that, before
picking this patch, we need to get PR #46357 merged to avoid new
problems.
Cheers,
--
Luís
fs/ceph/mdsmap.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/ceph/mdsmap.c b/fs/ceph/mdsmap.c
index 3fbabc98e1f7..fe4f1a6c3465 100644
--- a/fs/ceph/mdsmap.c
+++ b/fs/ceph/mdsmap.c
@@ -379,6 +379,8 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end, bool msgr2)
ceph_decode_skip_8(p, end, bad_ext);
/* required_client_features */
ceph_decode_skip_set(p, end, 64, bad_ext);
+ /* bal_rank_mask */
+ ceph_decode_skip_string(p, end, bad_ext);
ceph_decode_64_safe(p, end, m->m_max_xattr_size, bad_ext);
} else {
/* This forces the usage of the (sync) SETXATTR Op */
next reply other threads:[~2022-10-27 15:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-27 15:28 Luís Henriques [this message]
2022-10-28 1:28 ` [PATCH] ceph: fix mdsmap decode for v >= 17 Xiubo Li
2022-10-28 9:05 ` Luís Henriques
2022-10-30 12:37 ` Xiubo Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221027152811.7603-1-lhenriques@suse.de \
--to=lhenriques@suse.de \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=jlayton@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xiubli@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox