From patchwork Thu Nov 8 12:54:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 1715191 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 6F9CFDF280 for ; Thu, 8 Nov 2012 12:54:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755506Ab2KHMy3 (ORCPT ); Thu, 8 Nov 2012 07:54:29 -0500 Received: from mga03.intel.com ([143.182.124.21]:60715 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755497Ab2KHMy2 (ORCPT ); Thu, 8 Nov 2012 07:54:28 -0500 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga101.ch.intel.com with ESMTP; 08 Nov 2012 04:54:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,737,1344236400"; d="scan'208";a="165932727" Received: from unknown (HELO zyan5-mobl.ccr.corp.intel.com) ([10.255.21.122]) by AZSMGA002.ch.intel.com with ESMTP; 08 Nov 2012 04:54:23 -0800 From: "Yan, Zheng" To: sage@inktank.com, ceph-devel@vger.kernel.org Cc: "Yan, Zheng" Subject: [PATCH 2/2] mds: Clear lock flushed if replica is waiting for AC_LOCKFLUSHED Date: Thu, 8 Nov 2012 20:54:15 +0800 Message-Id: <1352379255-5621-2-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1352379255-5621-1-git-send-email-zheng.z.yan@intel.com> References: <1352379255-5621-1-git-send-email-zheng.z.yan@intel.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org From: "Yan, Zheng" So eval_gather() will not skip calling scatter_writebehind(), otherwise the replica lock may be in flushing state forever. Signed-off-by: Yan, Zheng --- src/mds/Locker.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index a1f957a..e2b1ff4 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -4383,8 +4383,12 @@ void Locker::handle_file_lock(ScatterLock *lock, MLock *m) if (lock->get_state() == LOCK_MIX_LOCK || lock->get_state() == LOCK_MIX_LOCK2 || lock->get_state() == LOCK_MIX_EXCL || - lock->get_state() == LOCK_MIX_TSYN) + lock->get_state() == LOCK_MIX_TSYN) { lock->decode_locked_state(m->get_data()); + // replica is waiting for AC_LOCKFLUSHED, eval_gather() should not + // delay calling scatter_writebehind(). + lock->clear_flushed(); + } if (lock->is_gathering()) { dout(7) << "handle_file_lock " << *in << " from " << from