From patchwork Mon Dec 3 00:58:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 10708513 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D306314E2 for ; Mon, 3 Dec 2018 00:58:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C29702A415 for ; Mon, 3 Dec 2018 00:58:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6A602A4E2; Mon, 3 Dec 2018 00:58:50 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 57BA52A4D8 for ; Mon, 3 Dec 2018 00:58:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725850AbeLCA6y (ORCPT ); Sun, 2 Dec 2018 19:58:54 -0500 Received: from mx2.suse.de ([195.135.220.15]:43064 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725785AbeLCA6y (ORCPT ); Sun, 2 Dec 2018 19:58:54 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 38D0EADC8; Mon, 3 Dec 2018 00:58:48 +0000 (UTC) From: NeilBrown To: Steve Dickson Date: Mon, 03 Dec 2018 11:58:24 +1100 Subject: [PATCH 1/3] nfs.conf: allow empty assignments. Cc: Justin Mitchell , linux-nfs@vger.kernel.org Message-ID: <154379870495.3215.5548604122736274107.stgit@noble> In-Reply-To: <154379862296.3215.11174339731963464375.stgit@noble> References: <154379862296.3215.11174339731963464375.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 A recent commit caused an error message (but didn't actually trigger an error) for a config file line like: foo = There is no good reason to treat this as an error, and we (SUSE) have established practice of expecting these to be accepted. Specifically "/etc/nfs.conf" includes "/etc/sysconfig/nfs" which contains lots of empty definitions. So remove the error message. Fixes: 1c2c18806800 ("nfs.conf: Removed buffer overruns") Signed-off-by: NeilBrown --- support/nfs/conffile.c | 5 ----- tests/nfsconf/01-errors.exp | 1 - 2 files changed, 6 deletions(-) diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c index 0e39aca6b468..77c5790c893c 100644 --- a/support/nfs/conffile.c +++ b/support/nfs/conffile.c @@ -405,11 +405,6 @@ conf_parse_line(int trans, char *line, const char *filename, int lineno, char ** "missing tag in assignment", filename, lineno); return; } - if (*val == '\0') { - xlog_warn("config error at %s:%d: " - "missing value in assignment", filename, lineno); - return; - } if (strcasecmp(line, "include")==0) { /* load and parse subordinate config files */ diff --git a/tests/nfsconf/01-errors.exp b/tests/nfsconf/01-errors.exp index 2bf1b8c7f65b..0b985b46267e 100644 --- a/tests/nfsconf/01-errors.exp +++ b/tests/nfsconf/01-errors.exp @@ -4,7 +4,6 @@ nfsconf: config error at 01-errors.conf:10: non-matched ']', ignoring until next nfsconf: config error at 01-errors.conf:11: ignoring line not in a section nfsconf: config error at 01-errors.conf:14: line not empty and not an assignment nfsconf: config error at 01-errors.conf:15: missing tag in assignment -nfsconf: config error at 01-errors.conf:16: missing value in assignment nfsconf: config error at 01-errors.conf:18: unmatched quotes [four] four = foo = bar From patchwork Mon Dec 3 00:58:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 10708515 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E8AE614E2 for ; Mon, 3 Dec 2018 00:58:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6D942A412 for ; Mon, 3 Dec 2018 00:58:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB9BD2A4D8; Mon, 3 Dec 2018 00:58:55 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 6EC792A412 for ; Mon, 3 Dec 2018 00:58:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725851AbeLCA67 (ORCPT ); Sun, 2 Dec 2018 19:58:59 -0500 Received: from mx2.suse.de ([195.135.220.15]:43092 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725785AbeLCA67 (ORCPT ); Sun, 2 Dec 2018 19:58:59 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4F7C1AD3B; Mon, 3 Dec 2018 00:58:53 +0000 (UTC) From: NeilBrown To: Steve Dickson Date: Mon, 03 Dec 2018 11:58:25 +1100 Subject: [PATCH 2/3] Let systemd know when rpc.statd is needed. Cc: Justin Mitchell , linux-nfs@vger.kernel.org Message-ID: <154379870498.3215.1051796458035422926.stgit@noble> In-Reply-To: <154379862296.3215.11174339731963464375.stgit@noble> References: <154379862296.3215.11174339731963464375.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 A recent change to set IgnoreOnIsolate for rpc-statd isn't quite sufficient (though it doesn't hurt). While rpc-statd does remain when systemctl isolate multi-user is run, its dependencies don't remain, so rpcbind might get killed, which makes rpc.statd rather useless. The reason this is all an issue is that systemd doesn't know that rpc-statd is needed - mount.nfs explicitly starts it rather than having a dependency start it. This can be rectified by explicitly telling systemd about the dependency using "systemctl add-wants". This can be done in the start-statd script, at the same time that rpc-statd is started. As --runtime dependency is used so that it doesn't persist across reboots. A new dependency will be created on next boot if an NFSv3 filesystem is mounted. With this in place, both rpc.statd and rpcbind remain. Actually, rpcbind.service is stopped, but rpcbind.socket remains, and when anything tries to contact rpcbind, rpcbind.service is automatically started and it re-reads its saved state. Signed-off-by: NeilBrown --- utils/statd/start-statd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/statd/start-statd b/utils/statd/start-statd index 82715b40c1af..54ced822016a 100755 --- a/utils/statd/start-statd +++ b/utils/statd/start-statd @@ -20,7 +20,12 @@ fi # First try systemd if it's installed. if [ -d /run/systemd/system ]; then # Quit only if the call worked. - systemctl start rpc-statd.service && exit + if systemctl start rpc-statd.service; then + # Ensure systemd knows not to stop rpc.statd or its dependencies + # on 'systemctl isolate ..' + systemctl add-wants --runtime remote-fs.target rpc-statd.service + exit 0 + fi fi cd / From patchwork Mon Dec 3 00:58:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 10708517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F050913BF for ; Mon, 3 Dec 2018 00:59:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E198E2A412 for ; Mon, 3 Dec 2018 00:59:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5A882A4D8; Mon, 3 Dec 2018 00:59:00 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 86FD42A412 for ; Mon, 3 Dec 2018 00:59:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725874AbeLCA7E (ORCPT ); Sun, 2 Dec 2018 19:59:04 -0500 Received: from mx2.suse.de ([195.135.220.15]:43104 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725785AbeLCA7E (ORCPT ); Sun, 2 Dec 2018 19:59:04 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7CD66AD3B; Mon, 3 Dec 2018 00:58:58 +0000 (UTC) From: NeilBrown To: Steve Dickson Date: Mon, 03 Dec 2018 11:58:25 +1100 Subject: [PATCH 3/3] systemd: run statd-notify even when nfs-client isn't enabled. Cc: Justin Mitchell , linux-nfs@vger.kernel.org Message-ID: <154379870500.3215.3980663938514502057.stgit@noble> In-Reply-To: <154379862296.3215.11174339731963464375.stgit@noble> References: <154379862296.3215.11174339731963464375.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 When NFS filesytems are mounted, nfs-client.target really should be enabled. However it is possible to mount NFS filesystems without this (providing gss isn't used) and it mostly works. One aspect that doesn't work is that sm-notify isn't run, so the server isn't told to drop any locks from the previous client instance. This can result in confusing failures: if a client crashes while holding a lock, it won't be able to get the same lock after a reboot. While this isn't a complete solution (nfs-client really should be enabled), adding a dependency from rpc-statd to rpc-statd-notify is easy, has no down sides, and could help avoid confusion. Signed-off-by: NeilBrown --- systemd/rpc-statd.service | 1 + 1 file changed, 1 insertion(+) diff --git a/systemd/rpc-statd.service b/systemd/rpc-statd.service index 1f4e6a8b92ab..3e92cf71add0 100644 --- a/systemd/rpc-statd.service +++ b/systemd/rpc-statd.service @@ -4,6 +4,7 @@ DefaultDependencies=no Conflicts=umount.target Requires=nss-lookup.target rpcbind.socket Wants=network-online.target +Wants=rpc-statd-notify.service After=network-online.target nss-lookup.target rpcbind.socket PartOf=nfs-utils.service