]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/btrfs/dev-replace.c
Btrfs: fix a use-after-free bug in btrfs_dev_replace_finishing
[karo-tx-linux.git] / fs / btrfs / dev-replace.c
index 5d844438b2d4ed461ce2abbee834a389a03ca270..2a9bd5bd24c3b7df699998e7c9ed515a791958d9 100644 (file)
@@ -535,10 +535,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
        list_add(&tgt_device->dev_alloc_list, &fs_info->fs_devices->alloc_list);
 
        btrfs_rm_dev_replace_srcdev(fs_info, src_device);
-       if (src_device->bdev) {
-               /* zero out the old super */
-               btrfs_scratch_superblock(src_device);
-       }
+
        /*
         * this is again a consistent state where no dev_replace procedure
         * is running, the target device is part of the filesystem, the