From: Sage Weil Date: Sat, 14 Dec 2013 00:39:02 +0000 (-0800) Subject: osd/ReplicatedPG: EBUSY on cache-evict when watchers are present X-Git-Tag: v0.75~45^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1403798327bcefac72244d623873f3ec78ad25fd;p=ceph.git osd/ReplicatedPG: EBUSY on cache-evict when watchers are present Linger operations will follow the object to the cache pool when the pool overlay process is set. If we evict the object, the object_info_t will go away along with the watch state and confusing things will happen. Prevent that from happening by returning EBUSY when you try to evict a watched object. Note that you *can* flush a watched object, and the dirty flag will be cleared. But you still can't evict it. Signed-off-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index f6ba6fd023a4..0ac5d6a4bae6 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -2946,6 +2946,10 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops) result = -EBUSY; break; } + if (!oi.watchers.empty()) { + result = -EBUSY; + break; + } result = _delete_head(ctx, true); } break;