From: Liu Bo Date: Fri, 18 May 2018 03:00:24 +0000 (+0800) Subject: Btrfs: remove always true check in unlock_up X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=d80bb3f905ccf70b2c4dde541cff7286e6f936e8;p=openwrt%2Fstaging%2Fblogic.git Btrfs: remove always true check in unlock_up As unlock_up() is written as for () { if (!path->locks[i]) break; ... if (... && path->locks[i]) { } } Apparently, @path->locks[i] is always true at this 'if'. Signed-off-by: Liu Bo Reviewed-by: David Sterba Reviewed-by: Qu Wenruo Signed-off-by: David Sterba --- diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 239682330929..973912ec8992 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -2330,7 +2330,7 @@ static noinline void unlock_up(struct btrfs_path *path, int level, no_skips = 1; t = path->nodes[i]; - if (i >= lowest_unlock && i > skip_level && path->locks[i]) { + if (i >= lowest_unlock && i > skip_level) { btrfs_tree_unlock_rw(t, path->locks[i]); path->locks[i] = 0; if (write_lock_level &&