From patchwork Tue Feb 19 17:36:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 2163821 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 099C73FCF6 for ; Tue, 19 Feb 2013 17:36:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758644Ab3BSRgZ (ORCPT ); Tue, 19 Feb 2013 12:36:25 -0500 Received: from mx12.netapp.com ([216.240.18.77]:9316 "EHLO mx12.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752238Ab3BSRgZ (ORCPT ); Tue, 19 Feb 2013 12:36:25 -0500 X-IronPort-AV: E=Sophos;i="4.84,696,1355126400"; d="scan'208";a="23946289" Received: from smtp2.corp.netapp.com ([10.57.159.114]) by mx12-out.netapp.com with ESMTP; 19 Feb 2013 09:36:11 -0800 Received: from leira.trondhjem.org.com (leira.trondhjem.org.vpn.netapp.com [10.55.79.212]) by smtp2.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id r1JHaAkb022695; Tue, 19 Feb 2013 09:36:10 -0800 (PST) From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH] NLM: Ensure that we resend all pending blocking locks after a reclaim Date: Tue, 19 Feb 2013 12:36:09 -0500 Message-Id: <1361295369-11804-1-git-send-email-Trond.Myklebust@netapp.com> X-Mailer: git-send-email 1.8.1.2 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Currently, nlmclnt_lock will break out of the for(;;) loop when the reclaimer wakes up the blocking lock thread by setting nlm_lck_denied_grace_period. This causes the lock request to fail with an ENOLCK error. The intention was always to ensure that we resend the lock request after the grace period has expired. Reported-by: Wangyuan Zhang Signed-off-by: Trond Myklebust Cc: stable@vger.kernel.org --- fs/lockd/clntproc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index 54f9e6c..52e5120 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c @@ -550,6 +550,9 @@ again: status = nlmclnt_block(block, req, NLMCLNT_POLL_TIMEOUT); if (status < 0) break; + /* Resend the blocking lock request after a server reboot */ + if (resp->status == nlm_lck_denied_grace_period) + continue; if (resp->status != nlm_lck_blocked) break; }