We don't have to check if tgt_device is null and then delete
it, because there wouldn't be a case where tgt_device will
be null in a mounted context. If the replacement is already
canceled then we won't be here, since there is a switch above
to deviate.

Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
 fs/btrfs/dev-replace.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c
index 3b0760f7ec8a..a4a05cbb7250 100644
--- a/fs/btrfs/dev-replace.c
+++ b/fs/btrfs/dev-replace.c
@@ -748,8 +748,7 @@ int btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info)
                   btrfs_dev_name(src_device), src_device->devid,
                   btrfs_dev_name(tgt_device));
 
-       if (tgt_device)
-               btrfs_destroy_dev_replace_tgtdev(fs_info, tgt_device);
+       btrfs_destroy_dev_replace_tgtdev(fs_info, tgt_device);
 
 leave:
        mutex_unlock(&dev_replace->lock_finishing_cancel_unmount);
-- 
2.15.0

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to