]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
small_io_bench_fs.cc: check return value of FileStore::mkfs/mount()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 28 May 2013 12:08:09 +0000 (14:08 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 31 May 2013 17:15:22 +0000 (19:15 +0200)
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 <danny.al-gaaf@bisect.de>
src/test/bench/small_io_bench_fs.cc

index 4a3adc9e5dd14ca838ce6dd069f78a39c10a3a93..61fbacc5570cabb7f1a114a8e945ff0b163b578b 100644 (file)
@@ -125,8 +125,16 @@ int main(int argc, char **argv)
 
   FileStore fs(vm["filestore-path"].as<string>(),
               vm["journal-path"].as<string>());
-  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;