From: Sage Weil Date: Sat, 25 Oct 2014 04:23:19 +0000 (-0700) Subject: os/LevelDBStore, RocksDBStore: fix race handling for get store size X-Git-Tag: v0.87~3^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2800%2Fhead;p=ceph.git os/LevelDBStore, RocksDBStore: fix race handling for get store size If we get ENOENT, skip this file, instead of adding in undefined stat values. Backport: firefly Signed-off-by: Sage Weil --- diff --git a/src/os/LevelDBStore.h b/src/os/LevelDBStore.h index 3dbc0f92dfd6..4617c5ca29a8 100644 --- a/src/os/LevelDBStore.h +++ b/src/os/LevelDBStore.h @@ -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; diff --git a/src/os/RocksDBStore.h b/src/os/RocksDBStore.h index 318f259bcbf4..5c3160f5c99a 100644 --- a/src/os/RocksDBStore.h +++ b/src/os/RocksDBStore.h @@ -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;