]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: tolerate ENOENT when statting.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Thu, 7 Apr 2011 21:03:39 +0000 (14:03 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Thu, 7 Apr 2011 21:37:23 +0000 (14:37 -0700)
This got broken in commit f842bcf893e42a4cefda07d0bbf86303b17ddcd7
so that on any MDS restart the OSD would die. Bad OSD! Bad!

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/osd/ReplicatedPG.cc

index 7c82b882d10a67594f5a352d1b1844d554dbb152..780e80945adf9f483396a83d182bd192633564e8 100644 (file)
@@ -1205,10 +1205,11 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops,
          struct stat st;
          memset(&st, 0, sizeof(st));
          result = osd->store->stat(coll, soid, &st);
-         if (result || (uint64_t)st.st_size != oi.size) {
+         if ((result && result != -ENOENT) ||
+             (uint64_t)st.st_size != oi.size) {
            osd->clog.error() << info.pgid << " " << soid << " oi.size " << oi.size
                              << " but stat got " << result << " size " << st.st_size << "\n";
-           assert(0 == "oi disagrees with stat");
+           assert(0 == "oi disagrees with stat, or error code on stat");
          }
        }
        info.stats.num_rd++;