]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: EBUSY on cache-evict when watchers are present
authorSage Weil <sage@inktank.com>
Sat, 14 Dec 2013 00:39:02 +0000 (16:39 -0800)
committerSage Weil <sage@inktank.com>
Fri, 20 Dec 2013 00:40:01 +0000 (16:40 -0800)
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 <sage@inktank.com>
src/osd/ReplicatedPG.cc

index f6ba6fd023a4cd437103c390986e7be39d572cc2..0ac5d6a4bae658d1894a66e8aebabfa57a1c6bef 100644 (file)
@@ -2946,6 +2946,10 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
          result = -EBUSY;
          break;
        }
+       if (!oi.watchers.empty()) {
+         result = -EBUSY;
+         break;
+       }
        result = _delete_head(ctx, true);
       }
       break;