]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG, tmap: return -ENOENT if the key to remove does not exist
authorJosh Durgin <josh.durgin@dreamhost.com>
Wed, 21 Sep 2011 00:22:35 +0000 (17:22 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Tue, 27 Sep 2011 01:10:39 +0000 (18:10 -0700)
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
src/osd/ReplicatedPG.cc

index 0a8261bb6272a283fe4c1f600bbafce2e32b6d31..20e8aa6d4b9de9b1a8738f55945942afdf1b776c 100644 (file)
@@ -1986,8 +1986,9 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops,
              if (!ip.end()) {
                ::decode(nextkey, ip);
                ::decode(nextval, ip);
-             } else
+             } else {
                have_next = false;
+             }
            }
            
            if (op == CEPH_OSD_TMAP_SET) {
@@ -2007,6 +2008,9 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops,
              dout(20) << "   create " << key << " " << val.length() << dendl;
              nkeys++;
            } else if (op == CEPH_OSD_TMAP_RM) {
+             if (!key_exists) {
+               return -ENOENT;
+             }
              // do nothing.
            }
          }