From 5ab62f5e8604133c8552047638564cab288d0d2c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 1 Dec 2008 14:01:45 -0800 Subject: [PATCH] mds: do not purge until leases expire --- src/mds/MDCache.cc | 2 +- src/mds/mdstypes.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index ff81f23297047..cbf33814b96df 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -6414,7 +6414,7 @@ void MDCache::eval_stray(CDentry *dn) if (in->snaprealm->has_past_parents()) return; // not until some snaps are deleted. } } - if (dn->is_replicated() || in->is_any_caps()) return; // wait + if (dn->is_replicated() || in->is_any_caps() || in->is_any_leases()) return; // wait if (!in->dirfrags.empty()) return; // wait for dirs to close/trim if (dn->state_test(CDentry::STATE_PURGING)) return; // already purging if (in->state_test(CInode::STATE_NEEDSRECOVER) || diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index 5c1ad6dc7464e..5a3a8b4891b13 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -1138,6 +1138,9 @@ protected: public: hash_map client_lease_map; + bool is_any_leases() { + return !client_lease_map.empty(); + } ClientLease *get_client_lease(int c) { if (client_lease_map.count(c)) return client_lease_map[c]; -- 2.39.5