]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #14540 from smithfarm/wip-18910-kraken
authorNathan Cutler <presnypreklad@gmail.com>
Wed, 19 Jul 2017 10:50:22 +0000 (12:50 +0200)
committerGitHub <noreply@github.com>
Wed, 19 Jul 2017 10:50:22 +0000 (12:50 +0200)
kraken: rbd-nbd: check /sys/block/nbdX/size to ensure kernel mapped correctly

Reviewed-by: Mykola Golub <mgolub@mirantis.com>
1  2 
src/tools/rbd_nbd/rbd-nbd.cc

index c3f4c5cf515ef6c837bc801387263277ac61cece,ea9008bc531d01c9b9020f7eaed199abc90b7c07..4971cb1181caeac4bb916aaa7bedec94b4af51bd
@@@ -75,8 -76,9 +76,10 @@@ static bool readonly = false
  static int nbds_max = 0;
  static int max_part = 255;
  static bool exclusive = false;
 +static int nbd = -1;
  
+ #define RBD_NBD_BLKSIZE 512UL
  #ifdef CEPH_BIG_ENDIAN
  #define ntohll(a) (a)
  #elif defined(CEPH_LITTLE_ENDIAN)
@@@ -492,7 -504,9 +517,8 @@@ static int do_map(int argc, const char 
    unsigned long flags;
    unsigned long size;
  
+   int index = 0;
    int fd[2];
 -  int nbd;
  
    uint8_t old_format;
    librbd::image_info_t info;