]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/tools/rbd/action/Import.cc
update sources to 12.2.10
[ceph.git] / ceph / src / tools / rbd / action / Import.cc
index b7ab85d7825d3e33f93b38f1e0143541c442990f..8a024d336c9d3f3414fa396929d317d3724fc860 100644 (file)
@@ -639,7 +639,7 @@ static int decode_imagemeta(int fd, uint64_t length, std::map<std::string, std::
   return 0;
 }
 
-static int do_import_header(int fd, int import_format, uint64_t &size, librbd::ImageOptions& opts,
+static int do_import_header(int fd, int import_format, librbd::ImageOptions& opts,
                             std::map<std::string, std::string>* imagemetas)
 {
   // There is no header in v1 image.
@@ -647,10 +647,6 @@ static int do_import_header(int fd, int import_format, uint64_t &size, librbd::I
     return 0;
   }
 
-  if (fd == STDIN_FILENO || size < utils::RBD_IMAGE_BANNER_V2.size()) {
-    return -EINVAL;
-  }
-
   int r;
   r = validate_banner(fd, utils::RBD_IMAGE_BANNER_V2);
   if (r < 0) {
@@ -885,7 +881,7 @@ static int do_import(librados::Rados &rados, librbd::RBD &rbd,
 #endif
   }
 
-  r = do_import_header(fd, import_format, size, opts, &imagemetas);
+  r = do_import_header(fd, import_format, opts, &imagemetas);
   if (r < 0) {
     std::cerr << "rbd: import header failed." << std::endl;
     goto done;