]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/LevelDBStore, RocksDBStore: fix race handling for get store size 2800/head
authorSage Weil <sage@redhat.com>
Sat, 25 Oct 2014 04:23:19 +0000 (21:23 -0700)
committerSage Weil <sage@redhat.com>
Sat, 25 Oct 2014 04:23:19 +0000 (21:23 -0700)
If we get ENOENT, skip this file, instead of adding in undefined stat
values.

Backport: firefly
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/LevelDBStore.h
src/os/RocksDBStore.h

index 3dbc0f92dfd648ab8072fce12c2577ff04646daf..4617c5ca29a8e5b5e680d26afadc50cccaeca2a4 100644 (file)
@@ -341,7 +341,10 @@ public:
       // happen when those files are being updated, data is being shuffled
       // and files get removed, in which case there's not much of a problem
       // as we'll get to them next time around.
-      if ((err < 0) && (err != -ENOENT)) {
+      if (err == -ENOENT) {
+       continue;
+      }
+      if (err < 0) {
         lderr(cct) << __func__ << " error obtaining stats for " << fpath
                    << ": " << cpp_strerror(err) << dendl;
         goto err;
index 318f259bcbf4cafc57aa418b8de725022b213a12..5c3160f5c99a4754b46846f24bd09c8fd806c969 100644 (file)
@@ -285,7 +285,10 @@ public:
       // happen when those files are being updated, data is being shuffled
       // and files get removed, in which case there's not much of a problem
       // as we'll get to them next time around.
-      if ((err < 0) && (err != -ENOENT)) {
+      if (err == -ENOENT) {
+       continue;
+      }
+      if (err < 0) {
         lderr(cct) << __func__ << " error obtaining stats for " << fpath
                    << ": " << cpp_strerror(err) << dendl;
         goto err;