Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4044564ybv; Mon, 10 Feb 2020 11:12:21 -0800 (PST) X-Google-Smtp-Source: APXvYqw91wwMGUNeKGU7jRCJIIi3aUmA/DA0NxcAKYuedrPdWLbcWlNYtInvSvD0+UWiryYFylBk X-Received: by 2002:a9d:68da:: with SMTP id i26mr2234271oto.65.1581361941763; Mon, 10 Feb 2020 11:12:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581361941; cv=none; d=google.com; s=arc-20160816; b=z7ZeNmyiehXQc5gX8a30PWEvI4Vaz9aMSCcF7/80BOJpHw6TRwGGKBZdXcwiviA4Ed 2BskrI7IDZ5/jCHnvd3XvICMcjNHKG3M1Ruu8TNQSVpPnTGcq2Z0Qar0iwy6/+IvTxTN eHJsrglMIn4wmU2TtGeSu4/u5pV42Xcs8Sv19fNguraFfmgZzTc4pxFUTTtgulzPn6zl hsuoUO9XqRRvdxAd7GsN/Ody14AbQmtORhQDz4X+Luwu0+R8X7bFDbre79cc1spXSh4N L/Ah8zkmB9pEgv9Yz/VSSwKLG3tXGl6isVJbvedotjog23iYIHd1K37SDEZLd1OjdReA WKYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=LbxxAbVV/Wuz/oyM+A4FJGzJfjXiwMKYJs3eJDFX1EY=; b=m3HpLAXrU/2muKHW2/xPDI8mbTOtPJwmXhf+XB4x61u6d8IWaMZt61gCFs5JxkUSx3 Qf7KKiwr36b3oLT19iJzAKsB6bnm+hA9fHgvrFs1VSk9sTYkdLWVe6E3Fp09Aix8g8Wt vxGrj7f5H0+kbMI2D8HhsWtzN7iyZRLhOBMiajY4bUNHpGIchFR8/5SgOfmepO0JS3Fp 7BebmF5WgZ9vv+1eFMcBj4FfP9BpQaXyGwlLwM79gQ7E0daImixDLFESMlDZr1VA4zjK xOgzBUlnL3VgB9gtGCcVCm1jSz8rvG2lt6EAGtyy7mS6emNIeMZvSkmBd27WkFXClcq9 5geg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f60t6V7W; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w135si507589oiw.44.2020.02.10.11.12.08; Mon, 10 Feb 2020 11:12:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f60t6V7W; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727056AbgBJTMF (ORCPT + 99 others); Mon, 10 Feb 2020 14:12:05 -0500 Received: from mail-yb1-f193.google.com ([209.85.219.193]:33323 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726831AbgBJTME (ORCPT ); Mon, 10 Feb 2020 14:12:04 -0500 Received: by mail-yb1-f193.google.com with SMTP id s35so4107652ybi.0 for ; Mon, 10 Feb 2020 11:12:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=LbxxAbVV/Wuz/oyM+A4FJGzJfjXiwMKYJs3eJDFX1EY=; b=f60t6V7W9TABh/nABgn3Zz6lNf2FG3QaBnL9v2JQbkKVla7dvHkfbx1nmfPDicces0 FrQAhMP46m+HL+xgo3HjhZxNx2liZAeNyVb9K2gHGUFz/AicwNQbTpLWq11hWUJHuRsa vB3tvdy36PtY+rkMDvdHUJSKA3Iyk+xu1AEG6gTI8NdYAG2Z+r2H8LMhQvjl3WPerS7V m7c0xUBDc0ElmpBHcwhOxCxgEaxqSrgx5/R5mp7uilbAqtoneYWr5+2vd5j3wk9OJxQA T4tOeDoX6XVOJ/4Uin5vi892guOEgRxWRfXww5U6icEeqGITv1VVMAUvnIMDzjzll+fE fjQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=LbxxAbVV/Wuz/oyM+A4FJGzJfjXiwMKYJs3eJDFX1EY=; b=ZiuN9Wksrfmw2ldP0m18509RnUPKhvQgRrvE6eWCKPMogTJG1yyhQssjDaR/iuojGm ZxvPua4GfjARAfac6WpD51k+OqB4wkTR7AhWvPyVj575aMT4ZIxKQiiZyA9/3ijh3bh/ mkDtqVK98lDGXvrQV8HbB0CjKqDih2b4RV595qBomAfY/VuYxbu2ndVgb5EYPwxjeM8P aDSAUhqIfLCXMXJwufTolQIPQTE8AJg3Y/RgSNXlQvKUQlZqXg7R3MQ17NRQsiwtpyJ5 x2rLBWpLz8ufdCNfe2qmwjt2BxZmJ6EJw/F3mxFdrb13DwUUNj4CVExnwJnnlPtXBMIx bdBg== X-Gm-Message-State: APjAAAX9WxLW13In9UDX6K7bwNe07RzBwnKQfg9AeeuWOWIimLo4eEVk xwx375bDyVpg5XtRVO3PChMS/xQKfg== X-Received: by 2002:a25:9d84:: with SMTP id v4mr2777474ybp.40.1581361923547; Mon, 10 Feb 2020 11:12:03 -0800 (PST) Received: from localhost.localdomain (c-68-40-189-247.hsd1.mi.comcast.net. [68.40.189.247]) by smtp.gmail.com with ESMTPSA id v133sm658860ywb.86.2020.02.10.11.12.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Feb 2020 11:12:03 -0800 (PST) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH] NFS: Ensure we time out if a delegreturn does not complete Date: Mon, 10 Feb 2020 14:09:54 -0500 Message-Id: <20200210190954.557351-1-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org We can't allow delegreturn to hold up nfs4_evict_inode() forever, since that can cause the memory shrinkers to block. This patch therefore ensures that we eventually time out, and complete the reclaim of the inode. Signed-off-by: Trond Myklebust --- fs/nfs/nfs4proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 6616a575711e..00fe674c8a49 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -6259,6 +6259,7 @@ static void nfs4_delegreturn_done(struct rpc_task *task, void *calldata) /* Fallthrough */ case -NFS4ERR_BAD_STATEID: case -NFS4ERR_STALE_STATEID: + case -ETIMEDOUT: task->tk_status = 0; break; case -NFS4ERR_OLD_STATEID: @@ -6349,7 +6350,7 @@ static int _nfs4_proc_delegreturn(struct inode *inode, const struct cred *cred, .rpc_client = server->client, .rpc_message = &msg, .callback_ops = &nfs4_delegreturn_ops, - .flags = RPC_TASK_ASYNC, + .flags = RPC_TASK_ASYNC | RPC_TASK_TIMEOUT, }; int status = 0; -- 2.24.1