From patchwork Fri Nov 25 13:07:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salvatore Bonaccorso X-Patchwork-Id: 13055917 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFE9DC4167B for ; Fri, 25 Nov 2022 13:08:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229469AbiKYNIP (ORCPT ); Fri, 25 Nov 2022 08:08:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbiKYNIP (ORCPT ); Fri, 25 Nov 2022 08:08:15 -0500 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 920862D1 for ; Fri, 25 Nov 2022 05:08:13 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id ho10so10260765ejc.1 for ; Fri, 25 Nov 2022 05:08:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=/QsZ0GR2pKzUfTYmbPBONT+OzoL0BUcbKhakZxRGyXI=; b=j9i91Oa1bkZGonRkX4BZVIKG6aUU95O6a9ycTLFbOv7epnaX22L+BR41v+agaYjDY0 bf2q2rrCuhHKq7MhPqtLv1oRIIbX4pj5CZ/ngv2ry+/AyHW0kFFGcUqDT2yYu59kFVdf KsTmm5wpWRZPZ5o5BhUGtkv6IIU2o5hUfslb1Rvi66IP3HNe+I+lcvpUaJ5g220Njuvl XrB1rqEgt+ON3XsJb+ZQkHNa0VfgVLaiA4nHMijykgaXgdYInlbRcNXJj+XMBiHkCj8F kTfQYajyRQQJI+4yt9VvShCPdtopV9XI3/CJu/t4oEUXBHHbf7EinlX8Y01V1M0uvP7v qHFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/QsZ0GR2pKzUfTYmbPBONT+OzoL0BUcbKhakZxRGyXI=; b=tzBbfpiFJ2lehFyXeluLkNpLMlIWxpWL2WExL7y9TWLsQfyuu+79zavM2/9oQ8tKf6 uhadLjx+Ctx/rbi8OxM2u1GoOgmEqIaHLGH2G9a83BrAcUhtXG7vCxYq6kHU3GRjczHt bQtfYCzCMFCsCgQhJRMn/ZYlsSPCltFJm4qeCpi9nQ0LD1fxxBA6RdhEMUQnCkVJhsD7 ThqOkdy0dDMyc1SdtUO64XTg23DQJAOnlLpozRunvylshMAAe72yRfVf0Ih3ET8CquIl +sRt+rwKuXlTCY2cf47apBuVW1+oW4ktkEomznf4dqnDtPM+W1zvnEOWLkX7yBMCwqE0 yj9A== X-Gm-Message-State: ANoB5plOmVHIJCRvOltx6EuQijtUkgCZmebMDQGDXa9jyx2q9YV+YFJ6 rUllmv/3zgacAZhFnInZjQ0= X-Google-Smtp-Source: AA0mqf4SyRggubNWUKdDL4GdeqtlWSAjF/YLuuOyKzYEQFkd74yeZugHsOEVvAeL63awzzAYjDKfZQ== X-Received: by 2002:a17:907:a509:b0:7bb:12ec:c8cd with SMTP id vr9-20020a170907a50900b007bb12ecc8cdmr7208899ejc.618.1669381692006; Fri, 25 Nov 2022 05:08:12 -0800 (PST) Received: from eldamar.lan (c-82-192-242-114.customer.ggaweb.ch. [82.192.242.114]) by smtp.gmail.com with ESMTPSA id d18-20020a170906305200b007b29d292852sm1552452ejd.148.2022.11.25.05.08.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 05:08:10 -0800 (PST) Sender: Salvatore Bonaccorso Received: by eldamar.lan (Postfix, from userid 1000) id 7443EBE2DE0; Fri, 25 Nov 2022 14:08:09 +0100 (CET) From: Salvatore Bonaccorso To: NeilBrown , Steve Dickson , linux-nfs@vger.kernel.org Cc: Andras Korn , Marco d'Itri , Michael Prokop , Salvatore Bonaccorso Subject: [PATCH 1/4] Revert "configure: make modprobe.d directory configurable." Date: Fri, 25 Nov 2022 14:07:22 +0100 Message-Id: <20221125130725.1977606-2-carnil@debian.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221125130725.1977606-1-carnil@debian.org> References: <20221125130725.1977606-1-carnil@debian.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org This reverts commit 7d76dd2e6f09a141eb6303b7343baa5c4f9c85ad. As part of the full revert of adding support via modprobe.d configuration to set sysctl settings of NFS-related modules when loading the modules. The approach caused problems with sysctl from busybox and with kmod as reported in Debian (https://bugs.debian.org/1024082) Signed-off-by: Salvatore Bonaccorso --- configure.ac | 12 ------------ systemd/Makefile.am | 6 ++---- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index 5d9cbf317453..4280cc770a45 100644 --- a/configure.ac +++ b/configure.ac @@ -71,18 +71,6 @@ AC_ARG_WITH(systemd, AM_CONDITIONAL(INSTALL_SYSTEMD, [test "$use_systemd" = 1]) AC_SUBST(unitdir) -modprobedir=/usr/lib/modprobe.d -AC_ARG_WITH(modprobedir, - [AS_HELP_STRING([--with-modprobedir@<:@=modprobe-dir-path@:>@],[install modprobe config files @<:@Default: /usr/lib/modprobe.d@:>@])], - if test "$withval" != "no" ; then - modprobedir=$withval - else - modprobedir= - fi - ) - AM_CONDITIONAL(INSTALL_MODPROBEDIR, [test -n "$modprobedir"]) - AC_SUBST(modprobedir) - AC_ARG_ENABLE(nfsv4, [AS_HELP_STRING([--disable-nfsv4],[disable support for NFSv4 @<:@default=no@:>@])], enable_nfsv4=$enableval, diff --git a/systemd/Makefile.am b/systemd/Makefile.am index 7b5ab84bd793..63a50bf2c07e 100644 --- a/systemd/Makefile.am +++ b/systemd/Makefile.am @@ -82,7 +82,5 @@ install-data-hook: $(unit_files) $(modprobe_files) else install-data-hook: $(modprobe_files) endif -if INSTALL_MODPROBEDIR - mkdir -p $(DESTDIR)$(modprobedir) - cp $(modprobe_files) $(DESTDIR)$(modprobedir) -endif + mkdir -p $(DESTDIR)/usr/lib/modprobe.d + cp $(modprobe_files) $(DESTDIR)/usr/lib/modprobe.d/ From patchwork Fri Nov 25 13:07:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salvatore Bonaccorso X-Patchwork-Id: 13055918 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 809BAC4332F for ; Fri, 25 Nov 2022 13:08:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229455AbiKYNIU (ORCPT ); Fri, 25 Nov 2022 08:08:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbiKYNIT (ORCPT ); Fri, 25 Nov 2022 08:08:19 -0500 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC1E963E0 for ; Fri, 25 Nov 2022 05:08:14 -0800 (PST) Received: by mail-ej1-x62d.google.com with SMTP id vp12so8935719ejc.8 for ; Fri, 25 Nov 2022 05:08:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=2Mf7bwOsr7qPoi1b05IvL2g9IAOPZSM2jFTge8ASUM4=; b=A7nTUyja8VqLh874NoNG7JZK9f7wQp3b5WX1LzXOFhUYUya4GC1cC/1IqMNtHPCUU2 /r4c6t0cW0oOikv1aAMFT4BrjjG/J/WPdcvulIjwDylS8qp7QsF/8CgZLams28xIp9jx RO0OlOAyZysmQNtF9wIKfXBTDpb4eArZmA5Kcnwb7YCwlVKh2SiCGGdNVAKv9tHJw6wY qkrF+M0L43rvtiYHlT3VX8AgQFpnyZkQeZg6uE0WR55KF88Tif44xCPUq6/qWWLRSfWw GJP1Lt4UFKZSZteEmxN+s5qnU5946GXoOE5QOS/DZWEDZi6Y9TVZc8fWwUCF2elNngTK yBIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=2Mf7bwOsr7qPoi1b05IvL2g9IAOPZSM2jFTge8ASUM4=; b=rO+OdXtKdQ5xL7wl5GjoNuE7KRAj6tIw0qhqYqeeDrCujWHYeoD1w4GEFHyAyNpYWv 2OcsXjyjS4FI6Z1DvTLVGt1l8lGRlY6hDz0BiQQ6QPDmDQ2vqR6mJgewARJVkztHwbik OgzKJ+o49FZ1zqRxaZHvj3dh+8jR16D7KLzB2YEN/4lH9PSVYlm2mNpyzdw4u8KS2zqk TAdotVCBF6CLctBGQMW5znCs+k65UD/yy/JnjH1Rjk9N9fSbwjH7tCoEY2rGM1pdaPe9 nW6Od/bF8+3MWVSfq932wJJ9h9BppX4xZHtmisJNrtS+52IC1kGTOGwHyZhTLWvhV9gP VWgg== X-Gm-Message-State: ANoB5pmRXm1dYp+ZVVBIkRDW+UWjh72LmCSpNFgY9a3nJn+SlhX+f3AS 7agFQS4s5UQa9IKAoQKdLhc= X-Google-Smtp-Source: AA0mqf7gnVEIBk4GshUAqslHSSJQS00lLhogHqtBIZoRPAU9avrSkYqpH3ABZx8Dl9vZuEU7KX7/jw== X-Received: by 2002:a17:906:398b:b0:7ad:b868:f096 with SMTP id h11-20020a170906398b00b007adb868f096mr32352947eje.295.1669381693250; Fri, 25 Nov 2022 05:08:13 -0800 (PST) Received: from eldamar.lan (c-82-192-242-114.customer.ggaweb.ch. [82.192.242.114]) by smtp.gmail.com with ESMTPSA id 9-20020a170906308900b007b8e069769esm1531243ejv.104.2022.11.25.05.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 05:08:12 -0800 (PST) Sender: Salvatore Bonaccorso Received: by eldamar.lan (Postfix, from userid 1000) id 207AFBE2EE7; Fri, 25 Nov 2022 14:08:11 +0100 (CET) From: Salvatore Bonaccorso To: NeilBrown , Steve Dickson , linux-nfs@vger.kernel.org Cc: Andras Korn , Marco d'Itri , Michael Prokop , Salvatore Bonaccorso Subject: [PATCH 2/4] Revert "modprobe: protect against sysctl errors" Date: Fri, 25 Nov 2022 14:07:23 +0100 Message-Id: <20221125130725.1977606-3-carnil@debian.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221125130725.1977606-1-carnil@debian.org> References: <20221125130725.1977606-1-carnil@debian.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org This reverts commit 5e60e38aa4ba251ef66610514be5f45c41519e0f. As part of the full revert of adding support via modprobe.d configuration to set sysctl settings of NFS-related modules when loading the modules. The approach caused problems with sysctl from busybox and with kmod as reported in Debian (https://bugs.debian.org/1024082) Signed-off-by: Salvatore Bonaccorso --- systemd/50-nfs.conf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/systemd/50-nfs.conf b/systemd/50-nfs.conf index 19e8ee734c8e..b56b2d765969 100644 --- a/systemd/50-nfs.conf +++ b/systemd/50-nfs.conf @@ -1,16 +1,16 @@ # Ensure all NFS systctl settings get applied when modules load # sunrpc module supports "sunrpc.*" sysctls -install sunrpc /sbin/modprobe --ignore-install sunrpc $CMDLINE_OPTS && { /sbin/sysctl -q --pattern sunrpc --system; exit 0; } +install sunrpc /sbin/modprobe --ignore-install sunrpc $CMDLINE_OPTS && /sbin/sysctl -q --pattern sunrpc --system # rpcrdma module supports sunrpc.svc_rdma.* -install rpcrdma /sbin/modprobe --ignore-install rpcrdma $CMDLINE_OPTS && { /sbin/sysctl -q --pattern sunrpc.svc_rdma --system; exit 0; } +install rpcrdma /sbin/modprobe --ignore-install rpcrdma $CMDLINE_OPTS && /sbin/sysctl -q --pattern sunrpc.svc_rdma --system # lockd module supports "fs.nfs.nlm*" and "fs.nfs.nsm*" sysctls -install lockd /sbin/modprobe --ignore-install lockd $CMDLINE_OPTS && { /sbin/sysctl -q --pattern fs.nfs.n[sl]m --system; exit 0; } +install lockd /sbin/modprobe --ignore-install lockd $CMDLINE_OPTS && /sbin/sysctl -q --pattern fs.nfs.n[sl]m --system # nfsv4 module supports "fs.nfs.*" sysctls (nfs_callback_tcpport and idmap_cache_timeout) -install nfsv4 /sbin/modprobe --ignore-install nfsv4 $CMDLINE_OPTS && { /sbin/sysctl -q --pattern 'fs.nfs.(nfs_callback_tcpport|idmap_cache_timeout)' --system; exit 0; } +install nfsv4 /sbin/modprobe --ignore-install nfsv4 $CMDLINE_OPTS && /sbin/sysctl -q --pattern 'fs.nfs.(nfs_callback_tcpport|idmap_cache_timeout)' --system # nfs module supports "fs.nfs.*" sysctls -install nfs /sbin/modprobe --ignore-install nfs $CMDLINE_OPTS && { /sbin/sysctl -q --pattern fs.nfs --system; exit 0; } +install nfs /sbin/modprobe --ignore-install nfs $CMDLINE_OPTS && /sbin/sysctl -q --pattern fs.nfs --system From patchwork Fri Nov 25 13:07:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salvatore Bonaccorso X-Patchwork-Id: 13055916 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC537C4332F for ; Fri, 25 Nov 2022 13:08:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229535AbiKYNIS (ORCPT ); Fri, 25 Nov 2022 08:08:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbiKYNIR (ORCPT ); Fri, 25 Nov 2022 08:08:17 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 811A22D1 for ; Fri, 25 Nov 2022 05:08:15 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id fy37so10185161ejc.11 for ; Fri, 25 Nov 2022 05:08:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=y4UPRNgYkTTgkIOvGTjmVSedLlvmZSyOq0T81C3zGQQ=; b=li3RvOfMk4XyI7OF5bateRXK0Ev0fSi7unzVhCnXohZM/noQ9TmvmLPT6JRwyzL6oo Q6iUMIzM9fjUCPCOGF3kP/CncpP1WViMl5Cfpgn2mPwVaTl+IAgZUFzNnZUXzr4cl42Z Vx8qe7vqnaptr21WV2xbiaL0SDoVSHHXkX3AmfJaiiO7lknNM9qoJ6uljPfBhQZ/95BE ypmq7hh0vAkgyUAEmg1AbNCPs8EIyftwRO5qrdW+USlbds1Rk3rqx44jBe4KtpUm1GWy b7Fa+ftRjg2xnNPvwhZMTi4WAQ/U7zYNNBrak/g56qJRDH/cwpASJFwnioOPEoacwrzc nJYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=y4UPRNgYkTTgkIOvGTjmVSedLlvmZSyOq0T81C3zGQQ=; b=NKTJWljY6PLDwA+3zw3tEWxslKbBWkBu1fGJ72KQ+a8TONgDR3GV1RRC7mqaKVC3w4 tFdcbt1xhSVZyf5oegU3rQdr+MjD/0ReCzlTvfFn0tVSGtrZs8rUZmANMEnrfn2ICZNa JlXX+br8JV2bhdQX47tndH85cb1uIWcowEKjFuYWHiAcRKh9blp1c/0OiRUDBPKIpra3 WjzPK1wbWF3zO68KY4RBTxOezfuqNMrqV6RKdNZxyHlGm6pDzvI54/dVEeZ1mYIZCyhE EGYdBQPcmuCeA2eskjaYZcOwqVisRfi/xH9pbt7Y6SyE67OoE/Dn+tFpplvfinvGtFCo CSDg== X-Gm-Message-State: ANoB5pnXa2M6E6iELidznrXuzbgLcrBRWXPKT+2wN5oixOqSTh476gfX q9IHmWSa1vhRO++Sl2gnfN+8hgtuTSJmdw== X-Google-Smtp-Source: AA0mqf4RVc/bugMEEbfhBijTlb6yZTVCcV8m0eiN3FOX6RpxqNLLZ8FwRhVbBFQpqsgduZLM9zeqcw== X-Received: by 2002:a17:906:398b:b0:7ad:b868:f096 with SMTP id h11-20020a170906398b00b007adb868f096mr32352998eje.295.1669381694005; Fri, 25 Nov 2022 05:08:14 -0800 (PST) Received: from eldamar.lan (c-82-192-242-114.customer.ggaweb.ch. [82.192.242.114]) by smtp.gmail.com with ESMTPSA id ta19-20020a1709078c1300b0078d46aa3b82sm1545365ejc.21.2022.11.25.05.08.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 05:08:13 -0800 (PST) Sender: Salvatore Bonaccorso Received: by eldamar.lan (Postfix, from userid 1000) id AB0FEBE2DE0; Fri, 25 Nov 2022 14:08:12 +0100 (CET) From: Salvatore Bonaccorso To: NeilBrown , Steve Dickson , linux-nfs@vger.kernel.org Cc: Andras Korn , Marco d'Itri , Michael Prokop , Salvatore Bonaccorso Subject: [PATCH 3/4] Revert "systemd: Apply all sysctl settings when NFS-related modules are loaded" Date: Fri, 25 Nov 2022 14:07:24 +0100 Message-Id: <20221125130725.1977606-4-carnil@debian.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221125130725.1977606-1-carnil@debian.org> References: <20221125130725.1977606-1-carnil@debian.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org This reverts commit afc7132dfb212ac1f676a5ac36d29a9e06325645. The approach caused problems with sysctl from busybox and with kmod as reported in Debian (https://bugs.debian.org/1024082). Signed-off-by: Salvatore Bonaccorso --- systemd/50-nfs.conf | 16 ---------------- systemd/Makefile.am | 10 ++-------- 2 files changed, 2 insertions(+), 24 deletions(-) delete mode 100644 systemd/50-nfs.conf diff --git a/systemd/50-nfs.conf b/systemd/50-nfs.conf deleted file mode 100644 index b56b2d765969..000000000000 --- a/systemd/50-nfs.conf +++ /dev/null @@ -1,16 +0,0 @@ -# Ensure all NFS systctl settings get applied when modules load - -# sunrpc module supports "sunrpc.*" sysctls -install sunrpc /sbin/modprobe --ignore-install sunrpc $CMDLINE_OPTS && /sbin/sysctl -q --pattern sunrpc --system - -# rpcrdma module supports sunrpc.svc_rdma.* -install rpcrdma /sbin/modprobe --ignore-install rpcrdma $CMDLINE_OPTS && /sbin/sysctl -q --pattern sunrpc.svc_rdma --system - -# lockd module supports "fs.nfs.nlm*" and "fs.nfs.nsm*" sysctls -install lockd /sbin/modprobe --ignore-install lockd $CMDLINE_OPTS && /sbin/sysctl -q --pattern fs.nfs.n[sl]m --system - -# nfsv4 module supports "fs.nfs.*" sysctls (nfs_callback_tcpport and idmap_cache_timeout) -install nfsv4 /sbin/modprobe --ignore-install nfsv4 $CMDLINE_OPTS && /sbin/sysctl -q --pattern 'fs.nfs.(nfs_callback_tcpport|idmap_cache_timeout)' --system - -# nfs module supports "fs.nfs.*" sysctls -install nfs /sbin/modprobe --ignore-install nfs $CMDLINE_OPTS && /sbin/sysctl -q --pattern fs.nfs --system diff --git a/systemd/Makefile.am b/systemd/Makefile.am index 63a50bf2c07e..e7f5d818a913 100644 --- a/systemd/Makefile.am +++ b/systemd/Makefile.am @@ -2,8 +2,6 @@ MAINTAINERCLEANFILES = Makefile.in -modprobe_files = 50-nfs.conf - unit_files = \ nfs-client.target \ rpc_pipefs.target \ @@ -53,7 +51,7 @@ endif man5_MANS = nfs.conf.man man7_MANS = nfs.systemd.man -EXTRA_DIST = $(unit_files) $(modprobe_files) $(man5_MANS) $(man7_MANS) +EXTRA_DIST = $(unit_files) $(man5_MANS) $(man7_MANS) generator_dir = $(unitdir)/../system-generators @@ -75,12 +73,8 @@ rpc_pipefs_generator_LDADD = ../support/nfs/libnfs.la if INSTALL_SYSTEMD genexec_PROGRAMS = nfs-server-generator rpc-pipefs-generator -install-data-hook: $(unit_files) $(modprobe_files) +install-data-hook: $(unit_files) mkdir -p $(DESTDIR)/$(unitdir) cp $(unit_files) $(DESTDIR)/$(unitdir) cp $(rpc_pipefs_mount_file) $(DESTDIR)/$(unitdir)/$(rpc_pipefsmount) -else -install-data-hook: $(modprobe_files) endif - mkdir -p $(DESTDIR)/usr/lib/modprobe.d - cp $(modprobe_files) $(DESTDIR)/usr/lib/modprobe.d/ From patchwork Fri Nov 25 13:07:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salvatore Bonaccorso X-Patchwork-Id: 13055919 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01DEAC43217 for ; Fri, 25 Nov 2022 13:08:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229554AbiKYNIW (ORCPT ); Fri, 25 Nov 2022 08:08:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbiKYNIV (ORCPT ); Fri, 25 Nov 2022 08:08:21 -0500 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9142C63E0 for ; Fri, 25 Nov 2022 05:08:20 -0800 (PST) Received: by mail-ed1-x529.google.com with SMTP id v8so6338694edi.3 for ; Fri, 25 Nov 2022 05:08:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=Au2Jln13q6UAwXwfIAB1ZDUVfQ/b9kFSlTxuCZ/p3Sk=; b=lTRzkHDU/MwwtzsQihvxsqHY3MFYwGiVyJjJWqEgXrhJ75QgJr+MuJEerzqwPr0HYE rCfcudCkDdXP+OMXqVfc7jsVI49KMoHvWDA+Ljs/8Yo/q5FMUYyaMrjvKeBwziSykZtk H1FMVkBDl7QoWtxsapSmpaum+AXyzY9noNKHxB0FPTqUt5dybTO3NcMezWHY1HPOCmnG tdXsQQ8g7elbSai/MaykUI6nDkcJ6tvA7exFTEHQeXu6VvrisUnYOlqKZc/etSpFLLQB yYKJ2/qrd0fAPaD4xZnHj9yKm+Ha8ax0PO5coDtLW+ZdM1ANjWnlGs3U1uG3QmK273Ws +JNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Au2Jln13q6UAwXwfIAB1ZDUVfQ/b9kFSlTxuCZ/p3Sk=; b=PzPWL6TJ2b8qqnLUYXVJmsVEwLopwhlc7C70t54HOempC5VSs1mAyLdN1Zer0c/vPB r/wJHg8waozRJnxEl2GYWIhgB+H1V9OlMbE8BAz6g3p43saASd5ZE61pKyTmBVCo1n7U aU5xQvnHLRP8/ewsI4Uq5EsorlGPhiNxSW/yP2glw6NZ0R0Lcz1R1ZejaeftKC1Mz606 nexEBX/MT5QL9bdJTM5PfzY0l8RM7DXilVfyuMM4oWnzHbCGitiuv4LlnFcUkExo7mS7 X0WyPKWZ8wBv2a6UbH621C1OSk8mGE/0e9wnamlOajpcW5mEOAkN/nIrzkqLfTOC+n0H mlFA== X-Gm-Message-State: ANoB5pnm0w99MSSxoLsGnaCjSkfI/TRVTwjTyjAdX8I3ghpv3sOLnWz9 X9l6Jd/QEDTUjjxH7cmRWGA= X-Google-Smtp-Source: AA0mqf5qjtJDZK4gKEWcaaY7vr92uKbEg4wS1hGFjuamPY2nMk5Zn0B+TxPLwe2oo2AvrCwzPIaK9Q== X-Received: by 2002:a05:6402:2b8b:b0:468:cae8:f5a6 with SMTP id fj11-20020a0564022b8b00b00468cae8f5a6mr35733980edb.263.1669381695649; Fri, 25 Nov 2022 05:08:15 -0800 (PST) Received: from eldamar.lan (c-82-192-242-114.customer.ggaweb.ch. [82.192.242.114]) by smtp.gmail.com with ESMTPSA id nb12-20020a1709071c8c00b0078df3b4464fsm1587671ejc.19.2022.11.25.05.08.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 05:08:14 -0800 (PST) Sender: Salvatore Bonaccorso Received: by eldamar.lan (Postfix, from userid 1000) id 24CC8BE2DE0; Fri, 25 Nov 2022 14:08:14 +0100 (CET) From: Salvatore Bonaccorso To: NeilBrown , Steve Dickson , linux-nfs@vger.kernel.org Cc: Andras Korn , Marco d'Itri , Michael Prokop , Salvatore Bonaccorso Subject: [PATCH 4/4] systemd: Apply all sysctl settings through udev rule when NFS-related modules are loaded Date: Fri, 25 Nov 2022 14:07:25 +0100 Message-Id: <20221125130725.1977606-5-carnil@debian.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221125130725.1977606-1-carnil@debian.org> References: <20221125130725.1977606-1-carnil@debian.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org sysctl settings (e.g. /etc/sysctl.conf and others) are normally loaded once at boot. If the module that implements some settings is no yet loaded, those settings don't get applied. Various NFS modules support various sysctl settings. If they are loaded after boot, they miss out. Add a new udev rule configuration to udev/rules.d/60-nfs.rules to apply the relevant settings when the module is loaded. Placing it in the systemd directory similarly as the coice for the original commit afc7132dfb21 ("systemd: Apply all sysctl settings when NFS-related modules are loaded"). Link: https://lore.kernel.org/linux-nfs/Y1KoKwu88PulcokW@eldamar.lan/ Link: https://bugs.debian.org/1022172 Link: https://bugs.debian.org/1024082 Suggested-by: Marco d'Itri Signed-off-by: Salvatore Bonaccorso --- systemd/60-nfs.rules | 21 +++++++++++++++++++++ systemd/Makefile.am | 9 +++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 systemd/60-nfs.rules diff --git a/systemd/60-nfs.rules b/systemd/60-nfs.rules new file mode 100644 index 000000000000..188423c1d2e3 --- /dev/null +++ b/systemd/60-nfs.rules @@ -0,0 +1,21 @@ +# Ensure all NFS systctl settings get applied when modules load + +# sunrpc module supports "sunrpc.*" sysctls +ACTION=="add", SUBSYSTEM=="module", KERNEL=="sunrpc", \ + RUN+="/sbin/sysctl -q --pattern ^sunrpc --system" + +# rpcrdma module supports sunrpc.svc_rdma.* +ACTION=="add", SUBSYSTEM=="module", KERNEL=="rpcrdma", \ + RUN+="/sbin/sysctl -q --pattern ^sunrpc.svc_rdma --system" + +# lockd module supports "fs.nfs.nlm*" and "fs.nfs.nsm*" sysctls +ACTION=="add", SUBSYSTEM=="module", KERNEL=="lockd", \ + RUN+="/sbin/sysctl -q --pattern ^fs.nfs.n[sl]m --system" + +# nfsv4 module supports "fs.nfs.*" sysctls (nfs_callback_tcpport and idmap_cache_timeout) +ACTION=="add", SUBSYSTEM=="module", KERNEL=="nfsv4", \ + RUN+="/sbin/sysctl -q --pattern ^fs.nfs.(nfs_callback_tcpport|idmap_cache_timeout) --system" + +# nfs module supports "fs.nfs.*" sysctls +ACTION=="add", SUBSYSTEM=="module", KERNEL=="nfs", \ + RUN+="/sbin/sysctl -q --pattern ^fs.nfs --system" diff --git a/systemd/Makefile.am b/systemd/Makefile.am index e7f5d818a913..577c6a2286c0 100644 --- a/systemd/Makefile.am +++ b/systemd/Makefile.am @@ -2,6 +2,9 @@ MAINTAINERCLEANFILES = Makefile.in +udev_rulesdir = /usr/lib/udev/rules.d/ +udev_files = 60-nfs.rules + unit_files = \ nfs-client.target \ rpc_pipefs.target \ @@ -51,7 +54,7 @@ endif man5_MANS = nfs.conf.man man7_MANS = nfs.systemd.man -EXTRA_DIST = $(unit_files) $(man5_MANS) $(man7_MANS) +EXTRA_DIST = $(unit_files) $(udev_files) $(man5_MANS) $(man7_MANS) generator_dir = $(unitdir)/../system-generators @@ -73,8 +76,10 @@ rpc_pipefs_generator_LDADD = ../support/nfs/libnfs.la if INSTALL_SYSTEMD genexec_PROGRAMS = nfs-server-generator rpc-pipefs-generator -install-data-hook: $(unit_files) +install-data-hook: $(unit_files) $(udev_files) mkdir -p $(DESTDIR)/$(unitdir) cp $(unit_files) $(DESTDIR)/$(unitdir) cp $(rpc_pipefs_mount_file) $(DESTDIR)/$(unitdir)/$(rpc_pipefsmount) + mkdir -p $(DESTDIR)/$(udev_rulesdir) + cp $(udev_files) $(DESTDIR)/$(udev_rulesdir) endif