From patchwork Thu Nov 19 19:30:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 7660871 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A42619F1C2 for ; Thu, 19 Nov 2015 19:31:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CBAC6204D9 for ; Thu, 19 Nov 2015 19:31:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 79946203FB for ; Thu, 19 Nov 2015 19:31:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161149AbbKSTb4 (ORCPT ); Thu, 19 Nov 2015 14:31:56 -0500 Received: from mail-qg0-f50.google.com ([209.85.192.50]:33590 "EHLO mail-qg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759159AbbKSTay (ORCPT ); Thu, 19 Nov 2015 14:30:54 -0500 Received: by qgea14 with SMTP id a14so58283626qge.0 for ; Thu, 19 Nov 2015 11:30:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poochiereds-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SBrHvzS0ygvMOJ1KyDY7ZbFuzvsvS7P8wnnmZTE9Xy8=; b=0HcddYQpx/GFeJ1OKSwQ9WiJ1qrvQx9tJRt67LwIgqFUa2PdXCJj+t3cPG5KPfdIfm KVUZHhUnCjfWJDJh3zjsud9f1kimSe3jsQqe//L9+0CnI5rF7mYToDEou9qiAJ3vouc+ jmfEK05GrffLrcPs+c5ODpSo/Fk8Qc2VZXy+qk9DjdPI1Mo5H2k5gQx/ZB7EgVdd+Ix0 2Oaly6Z1LiqBpjMI7NhdU9Clw8tAMsHLIvagVup8SAEqZ2Zosp+kt1TpyjZA6knSQvuS uX4Ur/4wD16bkitfPpIkczuR4XdINeS1CFWYml2nWC8J6TpkXy2LuaC0mSXNOZG4+rRQ O+yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SBrHvzS0ygvMOJ1KyDY7ZbFuzvsvS7P8wnnmZTE9Xy8=; b=Bfj1SwWuW+Ctc6kVSoo66DgfaKMqkFAyZK8ih4AM8z2wMtg93als03onYBDkmjCLZF GjgfBNKY37MLZmnZqplrI/9Kpg3GJQEaP1h5ZPnIytn5GPWhcAY3+ogZBAOsXz7oh7ES crU/YdZIUCmlslGTR4ag+l/wqhoJgPbtlkfT2UUZfDPcK2NhMDc/VleinHmz6APykNYI 7dGTg9x6WeczYfC4tmuWcoq9rRYRZ9+CRWSIQIwe2QENE8M1ml/UsaDP1eJoWiDxIWPZ vqjuy2eugDAcbmh+mgJqgRY1uY84Qwnt/wnt0vfWVm8ZM7F0Kgbl3g02ZgtHbX6siya9 jOHg== X-Gm-Message-State: ALoCoQmXVlvxbvib/PPVLhC7QmpdBB6u8hYv5BjPGQ+9L317vdUVx/7vctUtw3o10KdeMCx487jL X-Received: by 10.140.178.146 with SMTP id y140mr9391188qhy.100.1447961453388; Thu, 19 Nov 2015 11:30:53 -0800 (PST) Received: from tlielax.poochiereds.net ([2606:a000:1125:4075::d5a]) by smtp.googlemail.com with ESMTPSA id l124sm2698620qhc.24.2015.11.19.11.30.52 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Nov 2015 11:30:52 -0800 (PST) From: Jeff Layton X-Google-Original-From: Jeff Layton To: trond.myklebust@primarydata.com, anna.schumaker@netapp.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH] nfs: use sliding delay when LAYOUTGET gets NFS4ERR_DELAY Date: Thu, 19 Nov 2015 14:30:26 -0500 Message-Id: <1447961426-28828-1-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1446667037-28753-1-git-send-email-jeff.layton@primarydata.com> References: <1446667037-28753-1-git-send-email-jeff.layton@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When LAYOUTGET gets NFS4ERR_DELAY, we currently will wait 15s before retrying the call. That is a _very_ long time, so add a timeout value to struct nfs4_layoutget and pass nfs4_async_handle_error a pointer to it. This allows the RPC engine to use a sliding delay window, instead of a 15s delay. Signed-off-by: Jeff Layton --- fs/nfs/nfs4proc.c | 2 +- include/linux/nfs_xdr.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index ff5bddc49a2a..39155cfbed6a 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -7860,7 +7860,7 @@ static void nfs4_layoutget_done(struct rpc_task *task, void *calldata) spin_unlock(&inode->i_lock); goto out_restart; } - if (nfs4_async_handle_error(task, server, state, NULL) == -EAGAIN) + if (nfs4_async_handle_error(task, server, state, &lgp->timeout) == -EAGAIN) goto out_restart; out: dprintk("<-- %s\n", __func__); diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 570d630f98ae..11bbae44f4cb 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -251,6 +251,7 @@ struct nfs4_layoutget { struct nfs4_layoutget_res res; struct rpc_cred *cred; gfp_t gfp_flags; + long timeout; }; struct nfs4_getdeviceinfo_args {