From: Nikolay Borisov Date: Thu, 13 Sep 2018 08:35:00 +0000 (+0300) Subject: btrfs: Remove logically dead code from btrfs_orphan_cleanup X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=28bee489828ca7da9f9a0247a3fbe695fc0df6b4;p=linux.git btrfs: Remove logically dead code from btrfs_orphan_cleanup 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. Coverity-id: 1437392 Signed-off-by: Nikolay Borisov Reviewed-by: Lu Fengqi Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index e80304e4f16a9..8ba7e5d5071e8 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3468,8 +3468,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);