Skip to content

Commit 76aa1d3

Browse files
Josef Bacikaxboe
authored andcommitted
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 <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent fe1f9e6 commit 76aa1d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/block/nbd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ static int nbd_start_device_ioctl(struct nbd_device *nbd, struct block_device *b
11271127
if (ret)
11281128
sock_shutdown(nbd);
11291129
mutex_lock(&nbd->config_lock);
1130-
bd_set_size(bdev, 0);
1130+
nbd_bdev_reset(bdev);
11311131
/* user requested, ignore socket errors */
11321132
if (test_bit(NBD_DISCONNECT_REQUESTED, &config->runtime_flags))
11331133
ret = 0;

0 commit comments

Comments
 (0)