diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 7fec0c68b744b9d82ce2349a5cb3bc5f4c10b53c..ec3a874165dee394f5b0db820d42b6011c795590 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1118,6 +1118,9 @@ static void btrfs_close_one_device(struct btrfs_device *device) fs_devices->rw_devices--; } + if (device->devid == BTRFS_DEV_REPLACE_DEVID) + clear_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state); + if (test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state)) fs_devices->missing_devices--;