This patch seems to fix the issue:
```
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 5f807a6..b761971 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -98,11 +98,6 @@ static inline struct device *nbd_to_dev(struct nbd_device 
*nbd)
        return disk_to_dev(nbd->disk);
 }
 
-static bool nbd_is_connected(struct nbd_device *nbd)
-{
-       return !!nbd->task_recv;
-}
-
 static const char *nbdcmd_to_ascii(int cmd)
 {
        switch (cmd) {
@@ -126,9 +121,6 @@ static int nbd_size_clear(struct nbd_device *nbd, struct 
block_device *bdev)
 
 static void nbd_size_update(struct nbd_device *nbd, struct block_device *bdev)
 {
-       if (!nbd_is_connected(nbd))
-               return;
-
        bdev->bd_inode->i_size = nbd->bytesize;
        set_capacity(nbd->disk, nbd->bytesize >> 9);
        kobject_uevent(&nbd_to_dev(nbd)->kobj, KOBJ_CHANGE);
```

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1743026

Title:
  qemu-nbd -c /dev/nbd0 fails to map partitions

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1743026/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to