From patchwork Thu Jul 14 02:26:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 9228807 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 80B7A6086B for ; Thu, 14 Jul 2016 02:27:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E10327D5D for ; Thu, 14 Jul 2016 02:27:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62AD228066; Thu, 14 Jul 2016 02:27:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0C822808C for ; Thu, 14 Jul 2016 02:27:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751284AbcGNC1w (ORCPT ); Wed, 13 Jul 2016 22:27:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:57078 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750865AbcGNC1u (ORCPT ); Wed, 13 Jul 2016 22:27:50 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 412EBAC5D; Thu, 14 Jul 2016 02:27:49 +0000 (UTC) From: NeilBrown To: Steve Dickson Date: Thu, 14 Jul 2016 12:26:43 +1000 Subject: [PATCH 3/8] mountd: remove 'dev_missing' checks Cc: Linux NFS Mailing list Message-ID: <20160714022643.5874.84409.stgit@noble> In-Reply-To: <20160714021310.5874.22953.stgit@noble> References: <20160714021310.5874.22953.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I now think this was a mistaken idea. If a filesystem is exported with the "mountpoint" or "mp" option, it should only be exported if the directory is a mount point. The intention is that if there is a problem with one filesystem on a server, the others can still be exported, but clients won't incorrectly see the empty directory on the parent when accessing the missing filesystem, they will see clearly that the filesystem is missing. It is easy to handle this correctly for NFSv3 MOUNT requests, but what is the correct behavior if a client already has the filesystem mounted and so has a filehandle? Maybe the server rebooted and came back with one device missing. What should the client see? The "dev_missing" code tries to detect this case and causes the server to respond with silence rather than ESTALE. The idea was that the client would retry and when (or if) the filesystem came back, service would be transparently restored. The problem with this is that arbitrarily long delays are not what people would expect, and can be quite annoying. ESTALE, while unpleasant, it at least easily understood. A device disappearing is a fairly significant event and hiding it doesn't really serve anyone. So: remove the code and allow ESTALE. Signed-off-by: NeilBrown --- utils/mountd/cache.c | 12 ------------ 1 file changed, 12 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/utils/mountd/cache.c b/utils/mountd/cache.c index ec86a22613cf..346a8b3af8b5 100644 --- a/utils/mountd/cache.c +++ b/utils/mountd/cache.c @@ -687,7 +687,6 @@ static void nfsd_fh(int f) char *found_path = NULL; nfs_export *exp; int i; - int dev_missing = 0; char buf[RPC_CHAN_BUF_SIZE], *bp; int blen; @@ -754,11 +753,6 @@ static void nfsd_fh(int f) if (!is_ipaddr_client(dom) && !namelist_client_matches(exp, dom)) continue; - if (exp->m_export.e_mountpoint && - !is_mountpoint(exp->m_export.e_mountpoint[0]? - exp->m_export.e_mountpoint: - exp->m_export.e_path)) - dev_missing ++; if (!match_fsid(&parsed, exp, path)) continue; @@ -801,12 +795,6 @@ static void nfsd_fh(int f) /* FIXME we need to make sure we re-visit this later */ goto out; } - if (!found && dev_missing) { - /* The missing dev could be what we want, so just be - * quite rather than returning stale yet - */ - goto out; - } if (found) if (cache_export_ent(buf, sizeof(buf), dom, found, found_path) < 0)