Project

General

Profile

Actions

Bug #19871

closed

rbd-nbd: kernel reported invalid device size (0, expected 1073741824)

Added by Shengjing Zhu almost 7 years ago. Updated over 6 years ago.

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

0%

Source:
Tags:
Backport:
kraken,jewel
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
rbd
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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?


Related issues 2 (0 open2 closed)

Copied to rbd - Backport #20016: kraken: rbd-nbd: kernel reported invalid device size (0, expected 1073741824)RejectedActions
Copied to rbd - Backport #20017: jewel: rbd-nbd: kernel reported invalid device size (0, expected 1073741824)ResolvedNathan CutlerActions
Actions

Also available in: Atom PDF