btrfs: rw_devices shouldn't be incremented for seed fs in btrfs_rm_dev_replace_srcdev()
authorAnand Jain <Anand.Jain@oracle.com>
Wed, 13 Aug 2014 06:24:24 +0000 (14:24 +0800)
committerChris Mason <clm@fb.com>
Wed, 17 Sep 2014 20:38:10 +0000 (13:38 -0700)
seed fs devices don't participate as rw_device, so don't increment
rw_devices when the device being handled belongs to a seed fs.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/volumes.c

index 94a0d186de4c9e083ca3c3f4fcafe415b07cd115..8482396056eeee5d8e3ef96cb08d5b62e8d8ab1a 100644 (file)
@@ -1832,7 +1832,8 @@ void btrfs_rm_dev_replace_srcdev(struct btrfs_fs_info *fs_info,
        fs_devices->num_devices--;
        if (srcdev->missing) {
                fs_devices->missing_devices--;
-               fs_devices->rw_devices++;
+               if (!fs_devices->seeding)
+                       fs_devices->rw_devices++;
        }
        if (srcdev->can_discard)
                fs_devices->num_can_discard--;