Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3931740pxu; Mon, 30 Nov 2020 13:31:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDSAEoWBIQxIAIrWlc1BDIPESj/pdt102RK087zJPdBsXXtfIX1xXa+gtkitLX6NcbeFcm X-Received: by 2002:aa7:c5d0:: with SMTP id h16mr23821199eds.381.1606771865042; Mon, 30 Nov 2020 13:31:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606771865; cv=none; d=google.com; s=arc-20160816; b=Ghy5AKTCUDou0X3uqb8PN5UtygdzkOlQlIEPuU34qzswQozs9R6DqbOlzMMfh3Nupz xtoCWaUcfnAVgzrNpGP+mkLMLqsYspgaFwFkao1zQGV1PMuGcrnAgOx1gLeh3BJsI8br 60VlbJfcNOT1cFO5qq6Df+54uhLP/E636G0wAtAk9zEzKrbldiPcf/F/yml7zMSP96lx i5E6I0GHCQCnAwbdj3SbnWz89SK/wYf2nxNjr2JmKeWCUM5k4oUZHdKdw3a2hWHotwze JJ/aauHL5n+JCQb+kCX4fWInOhWnTGWfRA1xdRmTUXHE9OkB4eUwyLnGQ/1RnT/wZj3y 90wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nqbE+r16ckWaUn4Rl7Ch5GGruWtYjnxznIyjxsTu58c=; b=lm0WrU9ttnDdnQ1Zv324dDOF+o6i5y1qXKEMb/Mje1jqp8Ca96o0Rkk/xo8MgElRmY 7YKyw5jfOcWWQR/Zy1/AWruj2cfRrtvvuAw89fmaqAZgkRqDWH6Sv+ehM62kmFa3sDTb tEw894/7Okq8OX2s4rySgXNAgZM1bOKVi2JntZNtXc4p4DkoUOS1FuGkE759/Udhiauc JS+sqIeg+iQgr20GOp/7xYFJCJzrSaQoyuFefoDuQZlqG85l6Ny9n6Z7hmTHw82loTwa WVLA+hKc230tA8ynBJBV8gijezO7BJxT2ypqCD1YLX4P2Br3UJ7vz/bO1GgVPAOPvSOl uQpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bw1XRI0R; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si11789910eje.479.2020.11.30.13.30.41; Mon, 30 Nov 2020 13:31:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bw1XRI0R; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388607AbgK3V0W (ORCPT + 99 others); Mon, 30 Nov 2020 16:26:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:42340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388558AbgK3V0W (ORCPT ); Mon, 30 Nov 2020 16:26:22 -0500 Received: from leira.hammer.space (c-68-36-133-222.hsd1.mi.comcast.net [68.36.133.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E07BB208DB; Mon, 30 Nov 2020 21:25:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606771504; bh=N9/OPaZzIYV3a+AYR28ltm5smWP8Pti1uo38sJCxOt4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bw1XRI0RFZPV1+jPSsVBRG28TJ3unnVnStIT2ZGWS3DZ7IldJ48qFQmte/DSxadaq V+fBYB/C/d9mYtttP7fzCNYVTKIGrOVqwo/0mxxSF4POx2T0wEDZ9mPOnKSgzlLNlu Cxsv7/aBpAKnVWy3OzXUJHvV/X9TcnaXYZL5x+uM= From: trondmy@kernel.org To: "J. Bruce Fields" , Chuck Lever Cc: linux-nfs@vger.kernel.org Subject: [PATCH 5/6] nfsd: Fix up nfsd to ensure that timeout errors don't result in ESTALE Date: Mon, 30 Nov 2020 16:24:54 -0500 Message-Id: <20201130212455.254469-6-trondmy@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201130212455.254469-5-trondmy@kernel.org> References: <20201130212455.254469-1-trondmy@kernel.org> <20201130212455.254469-2-trondmy@kernel.org> <20201130212455.254469-3-trondmy@kernel.org> <20201130212455.254469-4-trondmy@kernel.org> <20201130212455.254469-5-trondmy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust If the underlying filesystem times out, then we want knfsd to return NFSERR_JUKEBOX/DELAY rather than NFSERR_STALE. Signed-off-by: Trond Myklebust --- fs/nfsd/nfsfh.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index 0c2ee65e46f3..46c86f7bc429 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c @@ -268,12 +268,20 @@ static __be32 nfsd_set_fh_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp) if (fileid_type == FILEID_ROOT) dentry = dget(exp->ex_path.dentry); else { - dentry = exportfs_decode_fh(exp->ex_path.mnt, fid, - data_left, fileid_type, - nfsd_acceptable, exp); - if (IS_ERR_OR_NULL(dentry)) + dentry = exportfs_decode_fh_raw(exp->ex_path.mnt, fid, + data_left, fileid_type, + nfsd_acceptable, exp); + if (IS_ERR_OR_NULL(dentry)) { trace_nfsd_set_fh_dentry_badhandle(rqstp, fhp, dentry ? PTR_ERR(dentry) : -ESTALE); + switch (PTR_ERR(dentry)) { + case -ENOMEM: + case -ETIMEDOUT: + break; + default: + dentry = ERR_PTR(-ESTALE); + } + } } if (dentry == NULL) goto out; -- 2.28.0