Actions
Bug #64139
closedrbd-nbd: image resizing doesn't update size of an image that is mapped using netlink interface
% Done:
0%
Source:
Tags:
backport_processed
Backport:
quincy,reef
Regression:
Yes
Severity:
3 - minor
Reviewed:
Description
From https://github.com/ceph/ceph/pull/55234#issuecomment-1899290071,
"
After a RBD image is mapped to a NBD device using the netlink interface, resizing of the image doesn't update the number of blocks of the NBD device (as seen in /proc/partitions). Only after the device is un-mapped and the image is re-mapped using the netlink interface, the correct block device size of the NBD device is reported.
$ rbd --cluster=site-a -p data create img-use-netlink --size 64M $ sudo ./bin/rbd --cluster=site-a device map -t nbd -o try-netlink data/img-use-netlink /dev/nbd4 $ awk -v dev="nbd4" '$4 == dev {print $3}' /proc/partitions 65536 $ rbd --cluster=site-a resize data/img-use-netlink --size 128M Resizing image: 100% complete...done. $ awk -v dev="nbd4" '$4 == dev {print $3}' /proc/partitions 65536 $ sleep 60; awk -v dev="nbd4" '$4 == dev {print $3}' /proc/partitions 65536 $ sudo ./bin/rbd --cluster=site-a device unmap -t nbd /dev/nbd4 $ sudo ./bin/rbd --cluster=site-a device map -t nbd -o try-netlink data/img-use-netlink $ # correct value reported after remapping $ awk -v dev="nbd4" '$4 == dev {print $3}' /proc/partitions 131072
"
In /var/log/messages observed the following after trying to resize,
localhost kernel: block nbd4: must specify backend
Hitting the following error in "drivers/block/nbd.c" kernel code,
https://github.com/ceph/ceph-client/blob/ceph-for-6.8-rc1/drivers/block/nbd.c#L2233
Observed in `netlink_resize()` of tools/rbd_nbd/rbd_nbd.cc that the backend device identifier (cookie) is not specified in the message sent to kernel to resize
https://github.com/ceph/ceph/blob/v19.0.0/src/tools/rbd_nbd/rbd-nbd.cc#L1349
Actions