All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiubo Li <xiubli@redhat.com>
To: Jeff Layton <jlayton@kernel.org>
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 21:12:42 +0800	[thread overview]
Message-ID: <d14840f4-3ad8-55ce-480c-4d8cf3234893@redhat.com> (raw)
In-Reply-To: <41b05af2020a3cb345a16f5dfca15f6f5f41bfe4.camel@kernel.org>


On 11/30/21 8:07 PM, Jeff Layton wrote:
> 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.
>
As I remembered, when I was paying the gluster-block project, the 
similar cases will always give a warning like this with code sanity 
checking.

>> ---
>>   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.
>


  reply	other threads:[~2021-11-30 13:12 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
2021-11-30 13:12   ` Xiubo Li [this message]
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=d14840f4-3ad8-55ce-480c-4d8cf3234893@redhat.com \
    --to=xiubli@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=ukernel@gmail.com \
    --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.