Bug #19871
closedrbd-nbd: kernel reported invalid device size (0, expected 1073741824)
0%
Description
before NBD_DO_IT, /sys/block/nbdX/size reports 0
so the check_device_size failed.
log:
rbd-nbd: kernel reported invalid device size (0, expected 1073741824)
rbd-nbd: failed to map, status: (22) Invalid argument
This failure depends on the kernel version. On kernel 4.4, it's ok. But on 4.9, which is the lts version and will shipped in next debian stable, /sys/block/nbdX/size will report 0 before you call NBD_DO_IT.
I haven't dig into kernel source. But after a quick search of the nbd module,
this line may be the reason:
http://elixir.free-electrons.com/linux/v4.9.18/source/drivers/block/nbd.c#L120
After look at the rbd-nbd.cc, I think there's no need to do the check, since
ioctl(nbd, NBD_SET_BLKSIZE, RBD_NBD_BLKSIZE) and ioctl(nbd, NBD_SET_SIZE, size)
all return ok.
But http://tracker.ceph.com/issues/18335 says the check is needed. So how can we handle it more correctly?
Updated by Mykola Golub almost 7 years ago
- Status changed from New to In Progress
- Assignee set to Mykola Golub
- Backport set to kraken,jewel
Updated by Mykola Golub almost 7 years ago
- Status changed from In Progress to Fix Under Review
Updated by Jason Dillaman almost 7 years ago
- Status changed from Fix Under Review to Pending Backport
Updated by Nathan Cutler almost 7 years ago
- Copied to Backport #20016: kraken: rbd-nbd: kernel reported invalid device size (0, expected 1073741824) added
Updated by Nathan Cutler almost 7 years ago
- Copied to Backport #20017: jewel: rbd-nbd: kernel reported invalid device size (0, expected 1073741824) added
Updated by Mehdi Abaakouk almost 7 years ago
- Severity changed from 3 - minor to 2 - major
This should be marked has urgent. The bug was introduced by a minor release of ceph. So what ever the kernel compatibility is. Ceph breaks users.
For example, I have a running client with kernel 4.7 rbd-nbd map was working fine with 10.2.6 and just break after I have upgraded to 10.2.8. Forcing me to rollback the package upgrade.
So I raise the severity to major, but I think it should be urgent.
Updated by Nathan Cutler over 6 years ago
- Status changed from Pending Backport to Resolved