linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ceph: fix mdsmap decode for v >= 17
@ 2022-10-27 15:28 Luís Henriques
  2022-10-28  1:28 ` Xiubo Li
  0 siblings, 1 reply; 4+ messages in thread
From: Luís Henriques @ 2022-10-27 15:28 UTC (permalink / raw)
  To: Xiubo Li, Ilya Dryomov, Jeff Layton, Luís Henriques
  Cc: ceph-devel, linux-kernel

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 */

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ceph: fix mdsmap decode for v >= 17
  2022-10-27 15:28 [PATCH] ceph: fix mdsmap decode for v >= 17 Luís Henriques
@ 2022-10-28  1:28 ` Xiubo Li
  2022-10-28  9:05   ` Luís Henriques
  0 siblings, 1 reply; 4+ messages in thread
From: Xiubo Li @ 2022-10-28  1:28 UTC (permalink / raw)
  To: Luís Henriques, Ilya Dryomov, Jeff Layton; +Cc: ceph-devel, linux-kernel


On 27/10/2022 23:28, Luís Henriques wrote:
> 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 */
>
Luis,

Because the ceph PR #43284 will break kclient here and your xattr size 
patch got merged long time ago, we should fix it in ceph. More detail 
please see my comments in:

https://github.com/ceph/ceph/pull/46357#issuecomment-1294290492

Thanks!

- Xiubo




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ceph: fix mdsmap decode for v >= 17
  2022-10-28  1:28 ` Xiubo Li
@ 2022-10-28  9:05   ` Luís Henriques
  2022-10-30 12:37     ` Xiubo Li
  0 siblings, 1 reply; 4+ messages in thread
From: Luís Henriques @ 2022-10-28  9:05 UTC (permalink / raw)
  To: Xiubo Li; +Cc: Ilya Dryomov, Jeff Layton, ceph-devel, linux-kernel

On Fri, Oct 28, 2022 at 09:28:37AM +0800, Xiubo Li wrote:
> 
> On 27/10/2022 23:28, Luís Henriques wrote:
> > 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 */
> > 
> Luis,
> 
> Because the ceph PR #43284 will break kclient here and your xattr size patch
> got merged long time ago, we should fix it in ceph. More detail please see
> my comments in:
> 
> https://github.com/ceph/ceph/pull/46357#issuecomment-1294290492

OK, agreed.  I'll update this PR to try to fix it on the MDS side
instead.  And let's try to have it merged as soon as possible to prevent
further issues.

Cheers,
--
Luís

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ceph: fix mdsmap decode for v >= 17
  2022-10-28  9:05   ` Luís Henriques
@ 2022-10-30 12:37     ` Xiubo Li
  0 siblings, 0 replies; 4+ messages in thread
From: Xiubo Li @ 2022-10-30 12:37 UTC (permalink / raw)
  To: Luís Henriques; +Cc: Ilya Dryomov, Jeff Layton, ceph-devel, linux-kernel


On 28/10/2022 17:05, Luís Henriques wrote:
> On Fri, Oct 28, 2022 at 09:28:37AM +0800, Xiubo Li wrote:
>> On 27/10/2022 23:28, Luís Henriques wrote:
>>> 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 */
>>>
>> Luis,
>>
>> Because the ceph PR #43284 will break kclient here and your xattr size patch
>> got merged long time ago, we should fix it in ceph. More detail please see
>> my comments in:
>>
>> https://github.com/ceph/ceph/pull/46357#issuecomment-1294290492
> OK, agreed.  I'll update this PR to try to fix it on the MDS side
> instead.  And let's try to have it merged as soon as possible to prevent
> further issues.

Sounds good!

- Xiubo


> Cheers,
> --
> Luís
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-30 12:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-27 15:28 [PATCH] ceph: fix mdsmap decode for v >= 17 Luís Henriques
2022-10-28  1:28 ` Xiubo Li
2022-10-28  9:05   ` Luís Henriques
2022-10-30 12:37     ` 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).