• P
    NBD: set uninitialized devices to size 0 · 4b86a872
    Paul Clements 提交于
    This fixes errors with utilities (such as LVM's vgscan) that try to scan all
    devices.  Previously this would generate read errors when uninitialized nbd
    devices were scanned:
    
    # vgscan
       Reading all physical volumes.  This may take a while...
       /dev/nbd0: read failed after 0 of 1024 at 0: Input/output error
       /dev/nbd0: read failed after 0 of 1024 at 509804544: Input/output error
       /dev/nbd0: read failed after 0 of 2048 at 0: Input/output error
       /dev/nbd1: read failed after 0 of 1024 at 509804544: Input/output error
       /dev/nbd1: read failed after 0 of 2048 at 0: Input/output error
    
     From now on, uninitialized nbd devices will have size zero, which
    prevents these errors.
    Signed-off-by: NPaul Clements <paul.clements@steeleye.com>
    Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    4b86a872
nbd.c 17.4 KB