Project

General

Profile

Bug #19871

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

Added by Shengjing Zhu 19 days ago. Updated 15 days ago.

Status:
Pending Backport
Priority:
Normal
Assignee:
Target version:
-
Start date:
05/05/2017
Due date:
% Done:

0%

Source:
Tags:
Backport:
kraken,jewel
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
rbd
Release:
master
Needs Doc:
No

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

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

History

#1 Updated by Mykola Golub 19 days ago

  • Status changed from New to In Progress
  • Assignee set to Mykola Golub
  • Backport set to kraken,jewel

#2 Updated by Mykola Golub 18 days ago

  • Status changed from In Progress to Need Review

#3 Updated by Jason Dillaman 15 days ago

  • Status changed from Need Review to Pending Backport

#4 Updated by Nathan Cutler 1 day ago

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

#5 Updated by Nathan Cutler 1 day ago

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

Also available in: Atom PDF