]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/LevelDBStore: handle deletion race when checking store size
authorSage Weil <sage@inktank.com>
Tue, 15 Oct 2013 22:39:04 +0000 (15:39 -0700)
committerSage Weil <sage@inktank.com>
Tue, 15 Oct 2013 22:39:04 +0000 (15:39 -0700)
This fixes the fix in 64774e5792f136df2bc78db686440fc2f3a7643f which mixed
up the return value and errno.

Fixes: #6550
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
src/os/LevelDBStore.h

index 89718ce19875953a2544645021353a12c755c810..bc5b612a97a048159509e32e02007868888a3d75 100644 (file)
@@ -329,13 +329,15 @@ public:
       string fpath = path + '/' + n;
       struct stat s;
       int err = stat(fpath.c_str(), &s);
+      if (err < 0)
+       err = -errno;
       // we may race against leveldb while reading files; this should only
       // 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)) {
         lderr(cct) << __func__ << " error obtaining stats for " << fpath
-                   << ": " << cpp_strerror(errno) << dendl;
+                   << ": " << cpp_strerror(err) << dendl;
         goto err;
       }