All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [bug report] ceph: perform asynchronous unlink if we have sufficient caps
Date: Thu, 23 Jan 2020 10:45:31 -0500	[thread overview]
Message-ID: <7ccd37a37f2f700bc648cafcd87784e85c784a31.camel@kernel.org> (raw)
In-Reply-To: <20200123153031.o53tzem7bhedyubg@kili.mountain>

On Thu, 2020-01-23 at 18:30 +0300, Dan Carpenter wrote:
> Hello Jeff Layton,
> 
> The patch d6566c62c529: "ceph: perform asynchronous unlink if we have
> sufficient caps" from Apr 2, 2019, leads to the following static
> checker warning:
> 
> 	fs/ceph/dir.c:1059 get_caps_for_async_unlink()
> 	error: uninitialized symbol 'got'.
> 
> fs/ceph/dir.c
>   1051  static bool get_caps_for_async_unlink(struct inode *dir, struct dentry *dentry)
>   1052  {
>   1053          struct ceph_inode_info *ci = ceph_inode(dir);
>   1054          struct ceph_dentry_info *di;
>   1055          int ret, want, got;
>   1056  
>   1057          want = CEPH_CAP_FILE_EXCL | CEPH_CAP_DIR_UNLINK;
>   1058          ret = ceph_try_get_caps(dir, 0, want, true, &got);
>   1059          dout("Fx on %p ret=%d got=%d\n", dir, ret, got);
>                                                            ^^^
> Uninitialized on error.
> 
>   1060          if (ret != 1 || got != want)
>   1061                  return false;
>   1062  
>   1063          spin_lock(&dentry->d_lock);
>   1064          di = ceph_dentry(dentry);
> 

Hi Dan,

This looks like a false positive to me?

On error, ret != 1, and got shouldn't matter in that case. If
ceph_try_get_caps does return 1 then "got" will be filled out.

Thanks,
-- 
Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2020-01-23 15:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23 15:30 [bug report] ceph: perform asynchronous unlink if we have sufficient caps Dan Carpenter
2020-01-23 15:45 ` Jeff Layton [this message]
2020-01-23 17:29   ` Dan Carpenter
2020-01-24 10:44     ` Jeff Layton
2020-01-24 13:01     ` Jeff Layton

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=7ccd37a37f2f700bc648cafcd87784e85c784a31.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dan.carpenter@oracle.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.