]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: verify that op_seq is nonzero
authorSage Weil <sage@inktank.com>
Thu, 24 May 2012 21:07:36 +0000 (14:07 -0700)
committerSage Weil <sage@inktank.com>
Thu, 24 May 2012 21:07:36 +0000 (14:07 -0700)
If we get zero from commit_op_seq something is very wrong, and we should
not continue.  Broken mkfs or something deleted commit_op_seq file.

Signed-off-by: Sage Weil <sage@inktank.com>
src/os/FileStore.cc

index aee914787ba2a730ed02358ad7fa4f65ba006032..330adfd5dfdfed2d23774833b185ca6adf8c2787 100644 (file)
@@ -1799,6 +1799,11 @@ int FileStore::mount()
   }
 
   dout(5) << "mount op_seq is " << initial_op_seq << dendl;
+  if (initial_op_seq == 0) {
+    derr << "mount initial op seq is 0; something is wrong" << dendl;
+    ret = -EINVAL;
+    goto close_current_fd;
+  }
 
   if (!btrfs_stable_commits) {
     // mark current/ as non-snapshotted so that we don't rollback away