From patchwork Wed Jul 11 20:30:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 1185341 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 650B83FC8F for ; Wed, 11 Jul 2012 20:30:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932367Ab2GKUan (ORCPT ); Wed, 11 Jul 2012 16:30:43 -0400 Received: from mail-yw0-f52.google.com ([209.85.213.52]:34087 "EHLO mail-yw0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932350Ab2GKUan (ORCPT ); Wed, 11 Jul 2012 16:30:43 -0400 Received: by mail-yw0-f52.google.com with SMTP id p61so1948409yhp.11 for ; Wed, 11 Jul 2012 13:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:subject:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=DAAkI/d2fbJMuHRpRNlMtG5DxoCj29J4u6axaDQOkgI=; b=BZP7OowS2zuhcxlEplFIIQjPMzUuEX3mN0v2n5UUIGa6jTb75vU3XM57UWN/cQwu0q ML87hE8A7LZpNB9Wjo8G626zz/z9Z1JUvBsI/ygAjAgVXHsU4qvjadtJrLReh6F9zOQv YFz4yDpYuzUvBWF5wPuSmiMoi7mNTzs9F3agxD+hNUl+aGwZLxoyVFLPG+mutf3feA5x lv0PLD1rydohaPxR2PsYco1H4alVsm3bRC6trYw+24h+zya408d8Um9iM7chYIyVHe6y pA0BykE7uPheE+bCihUq9++1IxCfdYr7uCpeVTmEh87Cu0YjBHzd+2OJ1Qs/wcJfpDDe W7ew== Received: by 10.50.6.230 with SMTP id e6mr15745750iga.47.1342038642761; Wed, 11 Jul 2012 13:30:42 -0700 (PDT) Received: from degas.1015granger.net (adsl-99-26-161-222.dsl.sfldmi.sbcglobal.net. [99.26.161.222]) by mx.google.com with ESMTPS id ut5sm4827741igc.13.2012.07.11.13.30.42 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Jul 2012 13:30:42 -0700 (PDT) From: Chuck Lever Subject: [PATCH 07/15] NFS: When state recovery fails, waiting tasks should exit To: trond.myklebust@netapp.com Cc: linux-nfs@vger.kernel.org Date: Wed, 11 Jul 2012 16:30:41 -0400 Message-ID: <20120711203040.3767.81860.stgit@degas.1015granger.net> In-Reply-To: <20120711201718.3767.66867.stgit@degas.1015granger.net> References: <20120711201718.3767.66867.stgit@degas.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org NFSv4 state recovery is not always successful. Failure is signalled by setting the nfs_client.cl_cons_state to a negative (errno) value, then waking waiters. Currently this can happen only during mount processing. I'm about to add an explicit case where state recovery failure during normal operation should force all NFS requests waiting on that state recovery to exit. Signed-off-by: Chuck Lever --- fs/nfs/nfs4proc.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 6444d27..997080d 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -259,7 +259,12 @@ static int nfs4_wait_clnt_recover(struct nfs_client *clp) res = wait_on_bit(&clp->cl_state, NFS4CLNT_MANAGER_RUNNING, nfs_wait_bit_killable, TASK_KILLABLE); - return res; + if (res) + return res; + + if (clp->cl_cons_state < 0) + return clp->cl_cons_state; + return 0; } static int nfs4_delay(struct rpc_clnt *clnt, long *timeout)