ReplicatedPG, tmap: return -ENOENT if the key to remove does not exist

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
This commit is contained in:
Josh Durgin 2011-09-20 17:22:35 -07:00
parent 74f07fbd56
commit 0cea48a64f

View 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.
}
}