btrfs: Remove superfluous check form btrfs_remove_chunk
authorNikolay Borisov <nborisov@suse.com>
Fri, 26 Oct 2018 11:43:19 +0000 (14:43 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Dec 2018 13:51:36 +0000 (14:51 +0100)
It's unnecessary to check map->stripes[i].dev for NULL given its value
is already set and dereferenced above the the check. No functional
changes.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c

index fc9a3d8f62384a46fbdbdc77d937af6ba10a3355..0839fae337f6fbc1bbdeee28b667d2021fe83e8e 100644 (file)
@@ -2848,13 +2848,11 @@ int btrfs_remove_chunk(struct btrfs_trans_handle *trans, u64 chunk_offset)
                        mutex_unlock(&fs_info->chunk_mutex);
                }
 
-               if (map->stripes[i].dev) {
-                       ret = btrfs_update_device(trans, map->stripes[i].dev);
-                       if (ret) {
-                               mutex_unlock(&fs_devices->device_list_mutex);
-                               btrfs_abort_transaction(trans, ret);
-                               goto out;
-                       }
+               ret = btrfs_update_device(trans, device);
+               if (ret) {
+                       mutex_unlock(&fs_devices->device_list_mutex);
+                       btrfs_abort_transaction(trans, ret);
+                       goto out;
                }
        }
        mutex_unlock(&fs_devices->device_list_mutex);