From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mikael Davranche Subject: [PATCH 2/3] NLM: Proposal for a timeout setting on blocking locks Date: Tue, 11 Mar 2008 13:16:47 +0100 Message-ID: <1205237807.47d6782f9b5dd@imp.free.fr> References: <1205237665.47d677a143941@imp.free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT To: Trond Myklebust , Trond Myklebust , linux-fsdevel Return-path: Received: from postfix2-g20.free.fr ([212.27.60.43]:40553 "EHLO postfix2-g20.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753220AbYCKMSX (ORCPT ); Tue, 11 Mar 2008 08:18:23 -0400 Received: from smtp6-g19.free.fr (smtp6-g19.free.fr [212.27.42.36]) by postfix2-g20.free.fr (Postfix) with ESMTP id AEA22244D10B for ; Tue, 11 Mar 2008 11:17:49 +0100 (CET) In-Reply-To: <1205237665.47d677a143941@imp.free.fr> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: # diff -u a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c --- a/fs/lockd/clntproc.c Tue Feb 26 01:20:20 2008 +++ b/fs/lockd/clntproc.c Fri Mar 7 18:08:58 2008 @@ -20,7 +20,6 @@ #define NLMDBG_FACILITY NLMDBG_CLIENT #define NLMCLNT_GRACE_WAIT (5*HZ) -#define NLMCLNT_POLL_TIMEOUT (30*HZ) #define NLMCLNT_MAX_RETRIES 3 static int nlmclnt_test(struct nlm_rqst *, struct file_lock *); @@ -525,7 +524,9 @@ if (resp->status != nlm_lck_blocked) break; /* Wait on an NLM blocking lock */ - status = nlmclnt_block(block, req, NLMCLNT_POLL_TIMEOUT); + if (!nlm_clnt_poll_timeout) + nlm_clnt_poll_timeout = NLMCLNT_POLL_TIMEOUT; + status = nlmclnt_block(block, req, nlm_clnt_poll_timeout * HZ); /* if we were interrupted. Send a CANCEL request to the server * and exit */