Bug #64139
closedrbd-nbd: image resizing doesn't update size of an image that is mapped using netlink interface
0%
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
Updated by Ramana Raja about 2 years ago
- Status changed from New to In Progress
- Assignee set to Ramana Raja
Updated by Ramana Raja about 2 years ago
- Status changed from In Progress to Fix Under Review
- Pull request ID set to 55287
Updated by Ilya Dryomov about 2 years ago
- Backport set to pacific,quincy,reef
- Regression changed from No to Yes
This is a regression introduced in https://github.com/ceph/ceph/pull/41323, caused by lacking test coverage for "-o try_netlink".
Updated by Ilya Dryomov about 2 years ago
- Backport changed from pacific,quincy,reef to quincy,reef
Too late for pacific.
Updated by Ilya Dryomov about 2 years ago
- Status changed from Fix Under Review to Pending Backport
Updated by Upkeep Bot about 2 years ago
- Copied to Backport #64180: quincy: rbd-nbd: image resizing doesn't update size of an image that is mapped using netlink interface added
Updated by Upkeep Bot about 2 years ago
- Copied to Backport #64181: reef: rbd-nbd: image resizing doesn't update size of an image that is mapped using netlink interface added
Updated by Upkeep Bot about 2 years ago
- Status changed from Pending Backport to Resolved
While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".
Updated by Upkeep Bot 9 months ago
- Merge Commit set to f7b52fc71268d97a9711d79e2eab27cc994923d7
- Fixed In set to v19.0.0-874-gf7b52fc7126
- Released In set to v19.2.0~857
- Upkeep Timestamp set to 2025-07-11T16:43:32+00:00