Project

General

Profile

Actions

Bug #64139

closed

rbd-nbd: image resizing doesn't update size of an image that is mapped using netlink interface

Added by Ramana Raja 3 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Tags:
backport_processed
Backport:
quincy,reef
Regression:
Yes
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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


Related issues 2 (0 open2 closed)

Copied to rbd - Backport #64180: quincy: rbd-nbd: image resizing doesn't update size of an image that is mapped using netlink interfaceResolvedRamana RajaActions
Copied to rbd - Backport #64181: reef: rbd-nbd: image resizing doesn't update size of an image that is mapped using netlink interfaceResolvedRamana RajaActions
Actions #1

Updated by Ramana Raja 3 months ago

  • Status changed from New to In Progress
  • Assignee set to Ramana Raja
Actions #2

Updated by Ramana Raja 3 months ago

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 55287
Actions #3

Updated by Ilya Dryomov 3 months 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".

Actions #4

Updated by Ilya Dryomov 3 months ago

  • Backport changed from pacific,quincy,reef to quincy,reef

Too late for pacific.

Actions #5

Updated by Ilya Dryomov 3 months ago

  • Status changed from Fix Under Review to Pending Backport
Actions #6

Updated by Backport Bot 3 months ago

  • Copied to Backport #64180: quincy: rbd-nbd: image resizing doesn't update size of an image that is mapped using netlink interface added
Actions #7

Updated by Backport Bot 3 months ago

  • Copied to Backport #64181: reef: rbd-nbd: image resizing doesn't update size of an image that is mapped using netlink interface added
Actions #8

Updated by Backport Bot 3 months ago

  • Tags set to backport_processed
Actions #9

Updated by Backport Bot 3 months 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".

Actions

Also available in: Atom PDF