Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp806528rwb; Tue, 4 Oct 2022 10:52:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6gbUN6GKpmcChgjaQu4YQjIQUiSjGwXvLDiMpA+29hY/gsqzYXw8Sy4ZqdJ3iggJNt1KRN X-Received: by 2002:a17:907:3f9f:b0:782:a14a:fdf9 with SMTP id hr31-20020a1709073f9f00b00782a14afdf9mr20158459ejc.49.1664905923832; Tue, 04 Oct 2022 10:52:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664905923; cv=none; d=google.com; s=arc-20160816; b=RMbdFx9AVaDGksBBnizRFSyeBZ3yylj0fzBwBa82CBkQax/rV3L4hG01aufp7Xu0We jyjONYJ5O8GQOPNjPOjMvfoxWlGaDew2G1RPGfIYizxUBXYuUt/XkK4J8HwtT7vANBOw /vrf4Pl4l3l3zmy8jkwds+1NHz0qTTiUEsG8nelq0lcf/VvK00AatFT3JbaU4zbn8ZC7 6QLCT5u3g5o1alg0R+pFDcFGq+mAhTjQhFdHGFUBuuq2UlzCFf+yChZ/j69BqrDykzqx MaUvZC7prNp1CXK3zXTBjw4kL7TnLpz2Wbwc+/5kcV/TrXNNDTycsMv/dwhpYCMULA0w Xl1A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=SCR9mlk85jb8kDj17yDLyneP5x5BC2d4THb6IR+XW7g=; b=zjt3Gec8t5vhkUzXJiYjar95+JYeasRYWMaAMfivj0XZjetyDycwPYUsI3DCjFqiRE Jz1nyqOzDeC4zY0k0v4hy6rZpc+QsQv3X1UY5OryNTU0BBBIwM+RZaZkRsw6pXpxxwWn 7r8hpkIQXvEzFXmaJl8HWjn4IVBz/ZwJ7R94zF0z98vR3WrPS1KOFx2PTgKoUoqbp+Q5 JmEu0IjaH9hnCNdtGDk370LTPNmJvdlIia8lqxbN5Pkcvqq8QMTkatUq8wEsAjwgqlRy 4Y7C/5k/3YopUtXTjm9QLOXl6LOBN1CehsU35UiBss8Gl5ZcnHQswoxWUocmxFulmiHS k30A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aSOFcaVa; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f16-20020a056402355000b00456f89d82b0si12023461edd.252.2022.10.04.10.51.28; Tue, 04 Oct 2022 10:52:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aSOFcaVa; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229739AbiJDRlC (ORCPT + 99 others); Tue, 4 Oct 2022 13:41:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229851AbiJDRke (ORCPT ); Tue, 4 Oct 2022 13:40:34 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 525814F3B3 for ; Tue, 4 Oct 2022 10:40:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664905218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=SCR9mlk85jb8kDj17yDLyneP5x5BC2d4THb6IR+XW7g=; b=aSOFcaVauB+b9suC2Rk61aUHlrZbf9Ueh6qQSEVzZ2IJLWYS2uplGnvSAKMfa3ogb1S17s whDPNvV9LflNRyAtix0Xk+9A4SQVa44fLW2Hqma5SxKcVUhVXMUDPhYcQEQkK0lPnuwKSS ILSkdaHuKSXs6L47VMmXYIAh0x+aozU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-316-2B0znjqHPJ29ypNMYpT46w-1; Tue, 04 Oct 2022 13:40:17 -0400 X-MC-Unique: 2B0znjqHPJ29ypNMYpT46w-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3E24480C8C1 for ; Tue, 4 Oct 2022 17:40:17 +0000 (UTC) Received: from bearskin.sorenson.redhat.com (unknown [10.2.17.101]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1537F4099B57; Tue, 4 Oct 2022 17:40:17 +0000 (UTC) From: Frank Sorenson To: linux-nfs@vger.kernel.org Cc: steved@redhat.com Subject: [PATCH nfs-utils] Allow 'debug' configuration option to accept '0' and '1' Date: Tue, 4 Oct 2022 12:40:15 -0500 Message-Id: <20221004174015.1362841-1-sorenson@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org In the example /etc/nfs.conf file, most sections include a commented-out 'debug = 0' line, suggesting that '0' is the default. In addition, the manpages for some of the utilities state that debugging can be enabled by setting 'debug = 1' in the nfs.conf file. However, neither '0' nor '1' is accepted as a valid option for 'debug' while parsing the nfs.conf file. Add '0' and '1' to the valid strings when parsing 'debug', with '0' not changing any debugging settings, and '1' enabling all debugging. Signed-off-by: Frank Sorenson --- support/nfs/xlog.c | 7 +++++-- systemd/nfs.conf.man | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/support/nfs/xlog.c b/support/nfs/xlog.c index e5861b9d..fa125cef 100644 --- a/support/nfs/xlog.c +++ b/support/nfs/xlog.c @@ -46,11 +46,13 @@ int export_errno = 0; static void xlog_toggle(int sig); static struct xlog_debugfac debugnames[] = { + { "0", 0, }, { "general", D_GENERAL, }, { "call", D_CALL, }, { "auth", D_AUTH, }, { "parse", D_PARSE, }, { "all", D_ALL, }, + { "1", D_ALL, }, { NULL, 0, }, }; @@ -119,13 +121,14 @@ xlog_sconfig(char *kind, int on) { struct xlog_debugfac *tbl = debugnames; - while (tbl->df_name != NULL && strcasecmp(tbl->df_name, kind)) + while (tbl->df_name != NULL && strcasecmp(tbl->df_name, kind)) tbl++; if (!tbl->df_name) { xlog (L_WARNING, "Invalid debug facility: %s\n", kind); return; } - xlog_config(tbl->df_fac, on); + if (tbl->df_fac) + xlog_config(tbl->df_fac, on); } void diff --git a/systemd/nfs.conf.man b/systemd/nfs.conf.man index e74083e9..b95c05a6 100644 --- a/systemd/nfs.conf.man +++ b/systemd/nfs.conf.man @@ -98,6 +98,12 @@ value, which can be one or more from the list .BR parse , .BR all . When a list is given, the members should be comma-separated. +The values +.BR 0 +and +.BR 1 +are also accepted, with '0' making no changes to the debug level, and '1' equivalent to specifying 'all'. + .TP .B general Recognized values: -- 2.37.2