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 Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1743026

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

Status in linux package in Ubuntu:
  Incomplete
Status in linux source package in Xenial:
  Incomplete

Bug description:
  [impact]
  4.4.0-101+ (also 4.4.0-109) Ubuntu kernels no longer can use qemu-nbd to 
mount virtual disks onto a local filesystem (see test case for reproducer). 
4.4.0-98 works without issue.

  I was able to bisect the issue down to
  907196aba0d891c6d580abe69c36d3b4fd512dcc (a cherry-pick from
  37091fdd831f28a6509008542174ed324dd645bc). Reverting this from 4.4
  fixes the issue.

  Installing the mainline kernel shows mainline is _not_ affected by
  this bug.

  In addition this is also reported in debian here:
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=829532

  [test case]
  # given a vmdk disk with multiple partitions
  sudo modprobe nbd
  sudo qemu-nbd -d /dev/nbd0
  sudo qemu-nbd -r -c /dev/nbd0 disk.vmdk
  ls /dev/nbd0*
  # here you won't see multiple partition, nor be able to mount a partition 
locally

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

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to