Skip to content

Commit c3f7c93

Browse files
Josef Bacikaxboe
authored andcommitted
nbd: update size when connected
I messed up changing the size of an NBD device while it was connected by not actually updating the device or doing the uevent. Fix this by updating everything if we're connected and we change the size. cc: [email protected] Fixes: 639812a ("nbd: don't set the device size until we're connected") Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 8364da4 commit c3f7c93

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/block/nbd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ static void nbd_size_set(struct nbd_device *nbd, loff_t blocksize,
246246
struct nbd_config *config = nbd->config;
247247
config->blksize = blocksize;
248248
config->bytesize = blocksize * nr_blocks;
249+
if (nbd->task_recv != NULL)
250+
nbd_size_update(nbd);
249251
}
250252

251253
static void nbd_complete_rq(struct request *req)

0 commit comments

Comments
 (0)