From 0cea48a64fcd8747f0af802f660ca125ae75771b Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Tue, 20 Sep 2011 17:22:35 -0700 Subject: [PATCH] ReplicatedPG, tmap: return -ENOENT if the key to remove does not exist Signed-off-by: Josh Durgin --- src/osd/ReplicatedPG.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 0a8261bb627..20e8aa6d4b9 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1986,8 +1986,9 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& 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& ops, dout(20) << " create " << key << " " << val.length() << dendl; nkeys++; } else if (op == CEPH_OSD_TMAP_RM) { + if (!key_exists) { + return -ENOENT; + } // do nothing. } }