All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ceph: fix the buf size and use NAME_SIZE instead
@ 2022-03-16  3:51 xiubli
  2022-03-16  4:15 ` Venky Shankar
  2022-03-16 11:50 ` Jeff Layton
  0 siblings, 2 replies; 5+ messages in thread
From: xiubli @ 2022-03-16  3:51 UTC (permalink / raw)
  To: jlayton; +Cc: idryomov, vshankar, lhenriques, ceph-devel, Xiubo Li

From: Xiubo Li <xiubli@redhat.com>

Since the base64_encrypted file name shouldn't exceed the NAME_SIZE,
no need to allocate a buffer from the stack that long.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
---

Jeff, you can just squash this into the previous commit.


 fs/ceph/mds_client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index c51b07ec72cf..cd0c780a6f84 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -2579,7 +2579,7 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *pbase, int for
 			parent = dget_parent(cur);
 		} else {
 			int len, ret;
-			char buf[FSCRYPT_BASE64URL_CHARS(NAME_MAX)];
+			char buf[NAME_MAX];
 
 			/*
 			 * Proactively copy name into buf, in case we need to present
-- 
2.27.0


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

* Re: [PATCH] ceph: fix the buf size and use NAME_SIZE instead
  2022-03-16  3:51 [PATCH] ceph: fix the buf size and use NAME_SIZE instead xiubli
@ 2022-03-16  4:15 ` Venky Shankar
  2022-03-16 11:50 ` Jeff Layton
  1 sibling, 0 replies; 5+ messages in thread
From: Venky Shankar @ 2022-03-16  4:15 UTC (permalink / raw)
  To: Xiubo Li; +Cc: Jeff Layton, Ilya Dryomov, Luis Henriques, ceph-devel

On Wed, Mar 16, 2022 at 9:21 AM <xiubli@redhat.com> wrote:
>
> From: Xiubo Li <xiubli@redhat.com>
>
> Since the base64_encrypted file name shouldn't exceed the NAME_SIZE,
> no need to allocate a buffer from the stack that long.
>
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
>
> Jeff, you can just squash this into the previous commit.
>
>
>  fs/ceph/mds_client.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index c51b07ec72cf..cd0c780a6f84 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -2579,7 +2579,7 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *pbase, int for
>                         parent = dget_parent(cur);
>                 } else {
>                         int len, ret;
> -                       char buf[FSCRYPT_BASE64URL_CHARS(NAME_MAX)];
> +                       char buf[NAME_MAX];
>
>                         /*
>                          * Proactively copy name into buf, in case we need to present
> --
> 2.27.0
>

Makes sense.

Acked-by: Venky Shankar <vshankar@redhat.com>

-- 
Cheers,
Venky


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

* Re: [PATCH] ceph: fix the buf size and use NAME_SIZE instead
  2022-03-16  3:51 [PATCH] ceph: fix the buf size and use NAME_SIZE instead xiubli
  2022-03-16  4:15 ` Venky Shankar
@ 2022-03-16 11:50 ` Jeff Layton
  2022-03-17  1:00   ` Xiubo Li
  2022-03-18  6:03   ` Xiubo Li
  1 sibling, 2 replies; 5+ messages in thread
From: Jeff Layton @ 2022-03-16 11:50 UTC (permalink / raw)
  To: xiubli; +Cc: idryomov, vshankar, lhenriques, ceph-devel

On Wed, 2022-03-16 at 11:51 +0800, xiubli@redhat.com wrote:
> From: Xiubo Li <xiubli@redhat.com>
> 
> Since the base64_encrypted file name shouldn't exceed the NAME_SIZE,
> no need to allocate a buffer from the stack that long.
> 
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
> 
> Jeff, you can just squash this into the previous commit.
> 
> 
>  fs/ceph/mds_client.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index c51b07ec72cf..cd0c780a6f84 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -2579,7 +2579,7 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *pbase, int for
>  			parent = dget_parent(cur);
>  		} else {
>  			int len, ret;
> -			char buf[FSCRYPT_BASE64URL_CHARS(NAME_MAX)];
> +			char buf[NAME_MAX];
>  
>  			/*
>  			 * Proactively copy name into buf, in case we need to present

Thanks Xiubo. I folded this into:

    ceph: add encrypted fname handling to ceph_mdsc_build_path

...and merged in the other patches you sent earlier today.

I also went ahead and squashed down the readdir patches that you sent
yesterday, so that we could get rid of the interim readdir handling that
I had originally written.

It might need a bit more cleanup -- some of the deltas in the merged
patch probably belong in earlier commits, but it should be ok for now.

Please take a look and make sure I didn't miss anything there.
-- 
Jeff Layton <jlayton@kernel.org>

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

* Re: [PATCH] ceph: fix the buf size and use NAME_SIZE instead
  2022-03-16 11:50 ` Jeff Layton
@ 2022-03-17  1:00   ` Xiubo Li
  2022-03-18  6:03   ` Xiubo Li
  1 sibling, 0 replies; 5+ messages in thread
From: Xiubo Li @ 2022-03-17  1:00 UTC (permalink / raw)
  To: Jeff Layton; +Cc: idryomov, vshankar, lhenriques, ceph-devel


On 3/16/22 7:50 PM, Jeff Layton wrote:
> On Wed, 2022-03-16 at 11:51 +0800, xiubli@redhat.com wrote:
>> From: Xiubo Li <xiubli@redhat.com>
>>
>> Since the base64_encrypted file name shouldn't exceed the NAME_SIZE,
>> no need to allocate a buffer from the stack that long.
>>
>> Signed-off-by: Xiubo Li <xiubli@redhat.com>
>> ---
>>
>> Jeff, you can just squash this into the previous commit.
>>
>>
>>   fs/ceph/mds_client.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
>> index c51b07ec72cf..cd0c780a6f84 100644
>> --- a/fs/ceph/mds_client.c
>> +++ b/fs/ceph/mds_client.c
>> @@ -2579,7 +2579,7 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *pbase, int for
>>   			parent = dget_parent(cur);
>>   		} else {
>>   			int len, ret;
>> -			char buf[FSCRYPT_BASE64URL_CHARS(NAME_MAX)];
>> +			char buf[NAME_MAX];
>>   
>>   			/*
>>   			 * Proactively copy name into buf, in case we need to present
> Thanks Xiubo. I folded this into:
>
>      ceph: add encrypted fname handling to ceph_mdsc_build_path
>
> ...and merged in the other patches you sent earlier today.
>
> I also went ahead and squashed down the readdir patches that you sent
> yesterday, so that we could get rid of the interim readdir handling that
> I had originally written.
>
> It might need a bit more cleanup -- some of the deltas in the merged
> patch probably belong in earlier commits, but it should be ok for now.
>
> Please take a look and make sure I didn't miss anything there.

Sure, will check it today.

- Xiubo



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

* Re: [PATCH] ceph: fix the buf size and use NAME_SIZE instead
  2022-03-16 11:50 ` Jeff Layton
  2022-03-17  1:00   ` Xiubo Li
@ 2022-03-18  6:03   ` Xiubo Li
  1 sibling, 0 replies; 5+ messages in thread
From: Xiubo Li @ 2022-03-18  6:03 UTC (permalink / raw)
  To: Jeff Layton; +Cc: idryomov, vshankar, lhenriques, ceph-devel


On 3/16/22 7:50 PM, Jeff Layton wrote:
> On Wed, 2022-03-16 at 11:51 +0800, xiubli@redhat.com wrote:
>> From: Xiubo Li <xiubli@redhat.com>
>>
>> Since the base64_encrypted file name shouldn't exceed the NAME_SIZE,
>> no need to allocate a buffer from the stack that long.
>>
>> Signed-off-by: Xiubo Li <xiubli@redhat.com>
>> ---
>>
>> Jeff, you can just squash this into the previous commit.
>>
>>
>>   fs/ceph/mds_client.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
>> index c51b07ec72cf..cd0c780a6f84 100644
>> --- a/fs/ceph/mds_client.c
>> +++ b/fs/ceph/mds_client.c
>> @@ -2579,7 +2579,7 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *pbase, int for
>>   			parent = dget_parent(cur);
>>   		} else {
>>   			int len, ret;
>> -			char buf[FSCRYPT_BASE64URL_CHARS(NAME_MAX)];
>> +			char buf[NAME_MAX];
>>   
>>   			/*
>>   			 * Proactively copy name into buf, in case we need to present
> Thanks Xiubo. I folded this into:
>
>      ceph: add encrypted fname handling to ceph_mdsc_build_path
>
> ...and merged in the other patches you sent earlier today.
>
> I also went ahead and squashed down the readdir patches that you sent
> yesterday, so that we could get rid of the interim readdir handling that
> I had originally written.
>
> It might need a bit more cleanup -- some of the deltas in the merged
> patch probably belong in earlier commits, but it should be ok for now.
>
> Please take a look and make sure I didn't miss anything there.

I have gone through the wip-fscrypt, all these look fine.

-- Xiubo



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

end of thread, other threads:[~2022-03-18  6:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16  3:51 [PATCH] ceph: fix the buf size and use NAME_SIZE instead xiubli
2022-03-16  4:15 ` Venky Shankar
2022-03-16 11:50 ` Jeff Layton
2022-03-17  1:00   ` Xiubo Li
2022-03-18  6:03   ` Xiubo Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.