From b4395889d78129f21d69a67932a367b4911f6870 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Thu, 14 Mar 2013 10:11:31 +0800 Subject: [PATCH] mds: avoid double auth pin for file recovery Signed-off-by: Yan, Zheng Reviewed-by: Greg Farnum --- src/mds/MDCache.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 9e1d80f096243..ac922ed69f9ee 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -5495,8 +5495,10 @@ void MDCache::_queue_file_recover(CInode *in) dout(15) << "_queue_file_recover " << *in << dendl; assert(in->is_auth()); in->state_clear(CInode::STATE_NEEDSRECOVER); - in->state_set(CInode::STATE_RECOVERING); - in->auth_pin(this); + if (!in->state_test(CInode::STATE_RECOVERING)) { + in->state_set(CInode::STATE_RECOVERING); + in->auth_pin(this); + } file_recover_queue.insert(in); } -- 2.39.5