Fixes: #2865
Signed-off-by: Sage Weil <sage@inktank.com>
[ $origsize = $exportsize ]
}
+# cannot import a dir
+mkdir foo.$$
+rbd import foo.$$ foo.dir && exit 1 || true # should fail
+rmdir foo.$$
+
# create a sparse file
dd if=/bin/sh of=/tmp/img bs=1k count=1 seek=10
dd if=/bin/dd of=/tmp/img bs=1k count=10 seek=100
cerr << "rbd: stat error " << path << std::endl;
goto done;
}
+ if (S_ISDIR(stat_buf.st_mode)) {
+ r = -EISDIR;
+ cerr << "rbd: cannot import a directory" << std::endl;
+ goto done;
+ }
if (stat_buf.st_size)
size = (uint64_t)stat_buf.st_size;