From: Danny Al-Gaaf Date: Tue, 28 May 2013 12:08:09 +0000 (+0200) Subject: small_io_bench_fs.cc: check return value of FileStore::mkfs/mount() X-Git-Tag: v0.65~168^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=679775ae2d5bda73e4b973cf2dcebce6df33dca4;p=ceph.git small_io_bench_fs.cc: check return value of FileStore::mkfs/mount() CID 743398 (#1 of 1): Unchecked return value (CHECKED_RETURN) check_return: Calling function "FileStore::mount()" without checking return value (as is done elsewhere 4 out of 5 times). unchecked_value: No check of the return value of "fs.FileStore::mount()" Signed-off-by: Danny Al-Gaaf --- diff --git a/src/test/bench/small_io_bench_fs.cc b/src/test/bench/small_io_bench_fs.cc index 4a3adc9e5dd1..61fbacc5570c 100644 --- a/src/test/bench/small_io_bench_fs.cc +++ b/src/test/bench/small_io_bench_fs.cc @@ -125,8 +125,16 @@ int main(int argc, char **argv) FileStore fs(vm["filestore-path"].as(), vm["journal-path"].as()); - fs.mkfs(); - fs.mount(); + + if (fs.mkfs() < 0) { + cout << "mkfs failed" << std::endl; + return 1; + } + + if (fs.mount() < 0) { + cout << "mount failed" << std::endl; + return 1; + } ostream *detailed_ops = 0; ofstream myfile;