From: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
To: Nikolay Borisov <nborisov@suse.com>
Cc: <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: Remove logically dead code from btrfs_orphan_cleanup
Date: Thu, 13 Sep 2018 16:42:22 +0800 [thread overview]
Message-ID: <20180913084222.GA10664@fnst.localdomain> (raw)
In-Reply-To: <1536827700-20477-1-git-send-email-nborisov@suse.com>
On Thu, Sep 13, 2018 at 11:35:00AM +0300, Nikolay Borisov wrote:
>In btrfs_orphan_cleanup the final 'if (ret) goto out' cannot ever be
>executed. This is due to the last assignment to 'ret' depending on
>the return value of btrfs_iget. If an error other than -ENOENT is
>returned then the loop is prematurely terminated by 'goto out'.
>On the other hand, if the error value is ENOENT then a subsequent
>if branch is executed that always re-assigns 'ret' and in case it's
>an error just terminates the loop. No functional changes.
>
>CID: 1437392
>Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
>---
> fs/btrfs/inode.c | 2 --
> 1 file changed, 2 deletions(-)
>
>diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
>index 3f03fec06a3a..64df0378a22f 100644
>--- a/fs/btrfs/inode.c
>+++ b/fs/btrfs/inode.c
>@@ -3471,8 +3471,6 @@ int btrfs_orphan_cleanup(struct btrfs_root *root)
>
> /* this will do delete_inode and everything for us */
> iput(inode);
>- if (ret)
>- goto out;
> }
> /* release the path since we're done with it */
> btrfs_release_path(path);
>--
>2.7.4
>
>
>
--
Thanks,
Lu
next prev parent reply other threads:[~2018-09-13 13:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-13 8:35 [PATCH] btrfs: Remove logically dead code from btrfs_orphan_cleanup Nikolay Borisov
2018-09-13 8:42 ` Lu Fengqi [this message]
2018-09-14 13:55 ` David Sterba
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=20180913084222.GA10664@fnst.localdomain \
--to=lufq.fnst@cn.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=nborisov@suse.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;
as well as URLs for NNTP newsgroup(s).