diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/volumes.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index e54b3fe92e90..51bd3ee8e64f 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -870,6 +870,11 @@ static void btrfs_close_one_device(struct btrfs_device *device) | |||
870 | if (device->missing) | 870 | if (device->missing) |
871 | fs_devices->missing_devices--; | 871 | fs_devices->missing_devices--; |
872 | 872 | ||
873 | if (device->bdev && device->writeable) { | ||
874 | sync_blockdev(device->bdev); | ||
875 | invalidate_bdev(device->bdev); | ||
876 | } | ||
877 | |||
873 | new_device = btrfs_alloc_device(NULL, &device->devid, | 878 | new_device = btrfs_alloc_device(NULL, &device->devid, |
874 | device->uuid); | 879 | device->uuid); |
875 | BUG_ON(IS_ERR(new_device)); /* -ENOMEM */ | 880 | BUG_ON(IS_ERR(new_device)); /* -ENOMEM */ |