* [PATCH] ceph: fix incorrectly decoding the mdsmap bug
@ 2021-11-05 9:34 xiubli
2021-11-05 10:29 ` Jeff Layton
0 siblings, 1 reply; 3+ messages in thread
From: xiubli @ 2021-11-05 9:34 UTC (permalink / raw)
To: jlayton; +Cc: idryomov, vshankar, pdonnell, khiremat, ceph-devel, Xiubo Li
From: Xiubo Li <xiubli@redhat.com>
When decreasing the 'max_mds' in the cephfs cluster, when the extra
MDS or MDSes are not removed yet, the mdsmap may only decreased the
'max_mds' but still having the that or those MDSes 'in' or in the
export targets list.
Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
fs/ceph/mdsmap.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/fs/ceph/mdsmap.c b/fs/ceph/mdsmap.c
index 61d67cbcb367..30387733765d 100644
--- a/fs/ceph/mdsmap.c
+++ b/fs/ceph/mdsmap.c
@@ -263,10 +263,6 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end, bool msgr2)
goto nomem;
for (j = 0; j < num_export_targets; j++) {
target = ceph_decode_32(&pexport_targets);
- if (target >= m->possible_max_rank) {
- err = -EIO;
- goto corrupt;
- }
info->export_targets[j] = target;
}
} else {
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ceph: fix incorrectly decoding the mdsmap bug
2021-11-05 9:34 [PATCH] ceph: fix incorrectly decoding the mdsmap bug xiubli
@ 2021-11-05 10:29 ` Jeff Layton
2021-11-05 13:22 ` Xiubo Li
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Layton @ 2021-11-05 10:29 UTC (permalink / raw)
To: xiubli; +Cc: idryomov, vshankar, pdonnell, khiremat, ceph-devel
On Fri, 2021-11-05 at 17:34 +0800, xiubli@redhat.com wrote:
> From: Xiubo Li <xiubli@redhat.com>
>
> When decreasing the 'max_mds' in the cephfs cluster, when the extra
> MDS or MDSes are not removed yet, the mdsmap may only decreased the
> 'max_mds' but still having the that or those MDSes 'in' or in the
> export targets list.
>
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
> fs/ceph/mdsmap.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/fs/ceph/mdsmap.c b/fs/ceph/mdsmap.c
> index 61d67cbcb367..30387733765d 100644
> --- a/fs/ceph/mdsmap.c
> +++ b/fs/ceph/mdsmap.c
> @@ -263,10 +263,6 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end, bool msgr2)
> goto nomem;
> for (j = 0; j < num_export_targets; j++) {
> target = ceph_decode_32(&pexport_targets);
> - if (target >= m->possible_max_rank) {
> - err = -EIO;
> - goto corrupt;
> - }
> info->export_targets[j] = target;
> }
> } else {
Thanks Xiubo, looks good. Given the severity when mdsmap decoding fails,
I think we should probably mark this for stable too. Let me know if you
have any objections.
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ceph: fix incorrectly decoding the mdsmap bug
2021-11-05 10:29 ` Jeff Layton
@ 2021-11-05 13:22 ` Xiubo Li
0 siblings, 0 replies; 3+ messages in thread
From: Xiubo Li @ 2021-11-05 13:22 UTC (permalink / raw)
To: Jeff Layton; +Cc: idryomov, vshankar, pdonnell, khiremat, ceph-devel
On 11/5/21 6:29 PM, Jeff Layton wrote:
> On Fri, 2021-11-05 at 17:34 +0800, xiubli@redhat.com wrote:
>> From: Xiubo Li <xiubli@redhat.com>
>>
>> When decreasing the 'max_mds' in the cephfs cluster, when the extra
>> MDS or MDSes are not removed yet, the mdsmap may only decreased the
>> 'max_mds' but still having the that or those MDSes 'in' or in the
>> export targets list.
>>
>> Signed-off-by: Xiubo Li <xiubli@redhat.com>
>> ---
>> fs/ceph/mdsmap.c | 4 ----
>> 1 file changed, 4 deletions(-)
>>
>> diff --git a/fs/ceph/mdsmap.c b/fs/ceph/mdsmap.c
>> index 61d67cbcb367..30387733765d 100644
>> --- a/fs/ceph/mdsmap.c
>> +++ b/fs/ceph/mdsmap.c
>> @@ -263,10 +263,6 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end, bool msgr2)
>> goto nomem;
>> for (j = 0; j < num_export_targets; j++) {
>> target = ceph_decode_32(&pexport_targets);
>> - if (target >= m->possible_max_rank) {
>> - err = -EIO;
>> - goto corrupt;
>> - }
>> info->export_targets[j] = target;
>> }
>> } else {
> Thanks Xiubo, looks good. Given the severity when mdsmap decoding fails,
> I think we should probably mark this for stable too. Let me know if you
> have any objections.
Yeah, it should be.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-05 13:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-05 9:34 [PATCH] ceph: fix incorrectly decoding the mdsmap bug xiubli
2021-11-05 10:29 ` Jeff Layton
2021-11-05 13:22 ` Xiubo Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).