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 #1

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
Actions #2

Updated by Mykola Golub almost 7 years ago

  • Status changed from In Progress to Fix Under Review
Actions #3

Updated by Jason Dillaman almost 7 years ago

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

Updated by Nathan Cutler almost 7 years ago

  • Copied to Backport #20016: kraken: rbd-nbd: kernel reported invalid device size (0, expected 1073741824) added
Actions #5

Updated by Nathan Cutler almost 7 years ago

  • Copied to Backport #20017: jewel: rbd-nbd: kernel reported invalid device size (0, expected 1073741824) added
Actions #6

Updated by Mehdi Abaakouk over 6 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.

Actions #7

Updated by Nathan Cutler over 6 years ago

  • Status changed from Pending Backport to Resolved
Actions

Also available in: Atom PDF