All of lore.kernel.org
 help / color / mirror / Atom feed
From: xiubli@redhat.com
To: jlayton@kernel.org
Cc: idryomov@gmail.com, vshankar@redhat.com, lhenriques@suse.de,
	ceph-devel@vger.kernel.org, Xiubo Li <xiubli@redhat.com>
Subject: [PATCH] ceph: fix the buf size and use NAME_SIZE instead
Date: Wed, 16 Mar 2022 11:51:00 +0800	[thread overview]
Message-ID: <20220316035100.68406-1-xiubli@redhat.com> (raw)

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


             reply	other threads:[~2022-03-16  3:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16  3:51 xiubli [this message]
2022-03-16  4:15 ` [PATCH] ceph: fix the buf size and use NAME_SIZE instead Venky Shankar
2022-03-16 11:50 ` Jeff Layton
2022-03-17  1:00   ` Xiubo Li
2022-03-18  6:03   ` 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=20220316035100.68406-1-xiubli@redhat.com \
    --to=xiubli@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=lhenriques@suse.de \
    --cc=vshankar@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 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.