Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4232615pxk; Tue, 8 Sep 2020 14:22:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/EqoHtNgxS8DNwEc7wnWFTq/uDO7E93ZFYEszw5vPakttLCbZSagRjHVAvmVSQ3/6TLI7 X-Received: by 2002:a17:906:fb8f:: with SMTP id lr15mr417583ejb.25.1599600169207; Tue, 08 Sep 2020 14:22:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599600169; cv=none; d=google.com; s=arc-20160816; b=gMo5OjEj6E5Qdm9Lk+tZ0+eWF0NDPqHJnRF9PpIqxOGA4RCBtl/L+pkUHduxVfHsmN B6KfOB+Yq59j2N6KcQfNOKL7q3vUZarCLAknN7PVtKwS+yq0X7SVuxfYxXXLfaP7NboC fz6VgBXA9PXgKAhfQKFmffjzSMB6L1QBilLZkuM2DXadH4b4LZhsnP+qsnSEDoirAciw 5UrmjrHxIzMFmL8+w0H5jeme50LLMzqaYMlyl/dUTrYNrocMtTQqgmAtYIope/6ku6oI Q7n8XTEG0p362YAiqwEcO4EcHli9oO81bzm0x3eK8nBHvtx6KxC8ZTPyHKL6ez52NV/n zrIQ== 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:cc:to:from:dkim-signature; bh=acwuFNo0YnWJy/XD0ObXQEhgt6GGWEf7e8qW+QUc7mQ=; b=HFS+uLviE3seQRvJmh6U3bUBzL09duV8JLemNmjsJKhRrvSQJ0HGjx6dKEcqkkiNjI NcqJ2n/UNNUSXN4DOMa309m6SX4FUQLRAbEsbv3J4dF6jjLQ1RWxhxB0WNNzivLVKmGS GYn0k9iadhIG8RYbqPMmr0Dpy0v75nBzAucqb7sHBO8kDnyF/oyjQ+YhE+T/NQrOa8uM 33YgEdczUD1J0xFBDF9qfvt2UfF3Yj1J5YNLbNijpy8szg421BHFuRYpaShy9GUSuGrG Y94XJaJF8ZT3jfcE4PnHzRIh0Sr0qwNEgErLRjgIxb/bK1otvcUNUws16yLbTbVsdmao Xg6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jwiJ0E22; 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 dv18si177375ejb.135.2020.09.08.14.22.15; Tue, 08 Sep 2020 14:22:49 -0700 (PDT) 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=jwiJ0E22; 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 S1728458AbgIHVWK (ORCPT + 99 others); Tue, 8 Sep 2020 17:22:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:50178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728390AbgIHVWI (ORCPT ); Tue, 8 Sep 2020 17:22:08 -0400 Received: from localhost.localdomain (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 A2AFE2087C; Tue, 8 Sep 2020 21:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599600127; bh=xjGHLZ644R5X1ZIl/BOJou1nJG4aRxf6oUivukUN47Y=; h=From:To:Cc:Subject:Date:From; b=jwiJ0E22INV4/swU/NgewPUJ4jLbJLeaQIt4vIOT8NtEQU+ic0FSW9/v05sQudtmX PSp7hT3RyMTUwMmpxzl8FEEj7VtqaJblDhPnW9dSBfTAe6AaZuhATY9nbVqALss17e ejBPciOkXPAMFi0URUhbES5PPQlb/nVdhszIdlg0= From: trondmy@kernel.org To: Steve Dickson Cc: linux-nfs@vger.kernel.org Subject: [PATCH] mountd: Ignore transient and non-fatal filesystem errors in nfsd_export Date: Tue, 8 Sep 2020 17:19:58 -0400 Message-Id: <20200908211958.38741-1-trondmy@kernel.org> X-Mailer: git-send-email 2.26.2 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 From: Trond Myklebust If the mount point check in nfsd_export fails due to a transient error, then ignore it to avoid spurious NFSERR_STALE errors being returned by knfsd. Signed-off-by: Trond Myklebust --- utils/mountd/cache.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c index 6cba2883026f..93e868341d15 100644 --- a/utils/mountd/cache.c +++ b/utils/mountd/cache.c @@ -1411,7 +1411,10 @@ static void nfsd_export(int f) if (mp && !*mp) mp = found->m_export.e_path; - if (mp && !is_mountpoint(mp)) + errno = 0; + if (mp && !is_mountpoint(mp)) { + if (errno != 0 && !path_lookup_error(errno)) + goto out; /* Exportpoint is not mounted, so tell kernel it is * not available. * This will cause it not to appear in the V4 Pseudo-root @@ -1420,9 +1423,12 @@ static void nfsd_export(int f) * And filehandle for this mountpoint from an earlier * mount will block in nfsd.fh lookup. */ + xlog(L_WARNING, + "Cannot export path '%s': not a mountpoint", + path); dump_to_cache(f, buf, sizeof(buf), dom, path, NULL, 60); - else if (dump_to_cache(f, buf, sizeof(buf), dom, path, + } else if (dump_to_cache(f, buf, sizeof(buf), dom, path, &found->m_export, 0) < 0) { xlog(L_WARNING, "Cannot export %s, possibly unsupported filesystem" -- 2.26.2