From 1403798327bcefac72244d623873f3ec78ad25fd Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 13 Dec 2013 16:39:02 -0800 Subject: [PATCH] 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 --- src/osd/ReplicatedPG.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index f6ba6fd023a4c..0ac5d6a4bae65 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; -- 2.39.5