Skip to contentSkip to conversation

nbd: update size when connected

PATCH New Josef Bacik 1 participant 1 message Mar 12, 2018

Subsystems (3)
lore
Share & tools
lore

Josef Bacik

author maintainer
#0 lore raw

PATCH 1/1 nbd: update size when connected

From: Josef Bacik <[email protected]>

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.

Fixes 639812a ("nbd: don't set the device size until we're connected")
---
 drivers/block/nbd.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/block/nbd.c +2 -0
index 86258b00a1d4..7106b98a35fb 100644
@@ -243,6 +243,8 @@ static void nbd_size_set(struct nbd_device *nbd, loff_t blocksize,
 	struct nbd_config *config = nbd->config;
 	config->blksize = blocksize;
 	config->bytesize = blocksize * nr_blocks;
+	if (nbd->task_recv != NULL)
+		nbd_size_update(nbd);
 }
 
 static void nbd_complete_rq(struct request *req)
Signature · 1 line
2.14.3