From: Jeff Layton <jlayton@kernel.org>
To: xiubli@redhat.com
Cc: idryomov@gmail.com, vshankar@redhat.com, ukernel@gmail.com,
ceph-devel@vger.kernel.org, dan.carpenter@oracle.com
Subject: Re: [PATCH] ceph: initialize pathlen variable in reconnect_caps_cb
Date: Tue, 30 Nov 2021 07:07:28 -0500 [thread overview]
Message-ID: <41b05af2020a3cb345a16f5dfca15f6f5f41bfe4.camel@kernel.org> (raw)
In-Reply-To: <20211130112034.2711318-1-xiubli@redhat.com>
On Tue, 2021-11-30 at 19:20 +0800, xiubli@redhat.com wrote:
> From: Xiubo Li <xiubli@redhat.com>
>
> Silence the potential compiler warning.
>
> Fixes: a33f6432b3a6 (ceph: encode inodes' parent/d_name in cap reconnect message)
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
Is this something we need to fix? AFAICT, there is no bug here.
In the case where ceph_mdsc_build_path returns an error, "path" will be
an ERR_PTR and then ceph_mdsc_free_path will be a no-op. If we do need
to take this, we should probably also credit Dan for finding it.
> ---
> 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 87f20ed16c6e..2fc2b0a023e4 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -3711,7 +3711,7 @@ static int reconnect_caps_cb(struct inode *inode, struct ceph_cap *cap,
> struct ceph_pagelist *pagelist = recon_state->pagelist;
> struct dentry *dentry;
> char *path;
> - int pathlen, err;
> + int pathlen = 0, err;
> u64 pathbase;
> u64 snap_follows;
>
If we do take this, you can also get rid of the place where pathlen is
set in the !dentry case.
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2021-11-30 12:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-30 11:20 [PATCH] ceph: initialize pathlen variable in reconnect_caps_cb xiubli
2021-11-30 12:07 ` Jeff Layton [this message]
2021-11-30 13:12 ` Xiubo Li
2021-11-30 13:55 ` Jeff Layton
2021-11-30 14:35 ` Dan Carpenter
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=41b05af2020a3cb345a16f5dfca15f6f5f41bfe4.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=ceph-devel@vger.kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=idryomov@gmail.com \
--cc=ukernel@gmail.com \
--cc=vshankar@redhat.com \
--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