diff options
author | Josef Bacik <jbacik@fb.com> | 2018-05-16 21:51:22 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-05-16 21:54:13 +0300 |
commit | 76aa1d341257c1beb6ecfdd67fecdaac7e2aee25 (patch) | |
tree | 446cae256f1f0a8994dec00d32b01cbf8c856f90 | |
parent | fe1f9e6659ca6124f500a0f829202c7c902fab0c (diff) |
nbd: call nbd_bdev_reset instead of bd_set_size on disconnect
We need to make sure we don't just set the size of the bdev to 0 while
it's being used by a file system. We have the appropriate check in
nbd_bdev_reset, simply use that helper instead.
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/block/nbd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 24788bd10c8b..abc0a815354f 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -1127,7 +1127,7 @@ static int nbd_start_device_ioctl(struct nbd_device *nbd, struct block_device *b if (ret) sock_shutdown(nbd); mutex_lock(&nbd->config_lock); - bd_set_size(bdev, 0); + nbd_bdev_reset(bdev); /* user requested, ignore socket errors */ if (test_bit(NBD_DISCONNECT_REQUESTED, &config->runtime_flags)) ret = 0; |