From patchwork Fri Nov 25 14:06:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salvatore Bonaccorso X-Patchwork-Id: 13055980 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 7A4A5C43217 for ; Fri, 25 Nov 2022 14:07:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229717AbiKYOHK (ORCPT ); Fri, 25 Nov 2022 09:07:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbiKYOHK (ORCPT ); Fri, 25 Nov 2022 09:07:10 -0500 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF9201EAFA for ; Fri, 25 Nov 2022 06:07:08 -0800 (PST) Received: by mail-ej1-x634.google.com with SMTP id ha10so10620053ejb.3 for ; Fri, 25 Nov 2022 06:07:08 -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=A33yTDzifZAAnLHPVh6Tk9AoRA7BtVeBQ7dtOdMue8k=; b=E/RgLsdBCqscHHZhTRNuqdG1wmO6LSqRDJapzeK+JbFBY+fFyGaUASxs25Bdy8WsOq 9vGFhCeCymgos6JCyL2Jksn20hb82F4wg8YijjRtL/6XgIgCC3LubzLiP5N/a9xGvbsW iEtxXIKWwsXW7Isy6tz2CqCauQEpU6cskjzm4YRP7pH1/C6qsEL59+xmejqIavddQ+C/ FDu9WiY2f/U7VuSE8YdoVQKMLo64Z3tuL1sa0KPP0wItsu6Ylmf54SpFq3FfeOZFvewE Wn2GT82I2TMwV4t/z2dNLHm+QeMoJqT0ZcXVlNbmTpMQcB+Lo9hR/foh/ssUT1qrWJ0L Wcfw== 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=A33yTDzifZAAnLHPVh6Tk9AoRA7BtVeBQ7dtOdMue8k=; b=f0GYjkj+4T9wbB62J/YGrfpLH/CmHhHSYzBjcGA46v9OzW863Q2b4PeX1Vxcu4DjIo mHuI8aY+pg8GcbnNowiM2EoHtfaowHkOdPRy8T+mcFr0OCHJBzYDMRqxJvcwHG06iC0L etZkf3vMbD4Z2T+ZgYJficF4fAzuWc3nhvfQjtzldnKuZ9zj2jaHN+X3zO7Q8EJIJdb/ 5Ro3Tm4Ue8g0aWY+WavMe3ZDMjelVBevD/URnzAJ4kvnGSF4CoqYd19rz2nP/DnES6ih oBLUvHsLjwxlBTRaYpwcMXAYTVCuAIOU30Ub9FmE442Eouk6p/vJf1NuYI2HYxlKPMMW LyBQ== X-Gm-Message-State: ANoB5pk5dACtcC/Yd1QY1AJf43dDRHZTpc94iVC+oaA1EE0erGjTtv1M 1vZsAEnAzUApd18EuhuBcn4+GEVE6re5YQ== X-Google-Smtp-Source: AA0mqf6UO7RMmqI2uMkQtTyXTyQt7RbjSNKA1Ba+jCjmO6zzs/I3+cJdCEYrgPDGKmWq2ryvyMi71w== X-Received: by 2002:a17:906:9f09:b0:7bc:db1b:206f with SMTP id fy9-20020a1709069f0900b007bcdb1b206fmr2131777ejc.719.1669385227282; Fri, 25 Nov 2022 06:07:07 -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 a4-20020aa7d744000000b004615f7495e0sm1821729eds.8.2022.11.25.06.07.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 06:07:06 -0800 (PST) Sender: Salvatore Bonaccorso Received: by eldamar.lan (Postfix, from userid 1000) id 0DF32BE2DE0; Fri, 25 Nov 2022 15:07:06 +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 v2 1/4] Revert "configure: make modprobe.d directory configurable." Date: Fri, 25 Nov 2022 15:06:53 +0100 Message-Id: <20221125140656.1985137-2-carnil@debian.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221125140656.1985137-1-carnil@debian.org> References: <20221125140656.1985137-1-carnil@debian.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org This reverts commit 7d76dd2e6f09a141eb6303b7343baa5c4f9c85ad. This is 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 14:06:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salvatore Bonaccorso X-Patchwork-Id: 13055982 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 BCC80C4167B for ; Fri, 25 Nov 2022 14:07:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229648AbiKYOHL (ORCPT ); Fri, 25 Nov 2022 09:07:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229694AbiKYOHK (ORCPT ); Fri, 25 Nov 2022 09:07:10 -0500 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7639B1EC47 for ; Fri, 25 Nov 2022 06:07:09 -0800 (PST) Received: by mail-ej1-x630.google.com with SMTP id f18so10597729ejz.5 for ; Fri, 25 Nov 2022 06:07:09 -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=GcyNN6uzrcq89PuZTNX9upan9NehOZI7PkDkywoJLW8=; b=HK91dpmnbriaIeM9MW3FdZGE0nb6bLUndPF1DXiy7djBrrjXLWST/5MpDgtZcwt0iH hk70Mi1T2A4yXn1Sl3n6rTyIfTBDy6BD3rlI+29VwZCy9Lyey2WNXx+wp2XQAw/o6/3Z H7A+H6KTYKdfFJIyNEcRHxcyUJ/NSm7TLPMlDkQTAyfcUxl16IE9bOk+CRiKInJSopN4 KUtdHJUdEPij9Hk2BXgtTXmRhx8b9vgwiXjTmoBs69nGD0LDL2MELOZ7Nrgjqpqq3M6U k2EEich93xXyHWl0x+GJwzmt11m+tfGdAm/QPFbC5CwC9dlFIjxNjIS64gtu1fN6z9k0 K5qg== 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=GcyNN6uzrcq89PuZTNX9upan9NehOZI7PkDkywoJLW8=; b=YI6yo1w7H9nizp05tzeN1ovQCe1KB++aEosf0iJy1WbB1ojtx1FBEWEEX4JB+g0He1 vtZKgN/A1r+HTxCiSTXwKab3c7MFNA8EHD74hz0nz48Qc/94vfL7Z2LEPN3uJy2gOmXc FkZX8nIBQDAOSgFL7rFzBX/iWAmNJJKUcmwnGtCDE4/zNXsSzWieN1S3JSfc8HGGDk1o 5WIhs2jGaCq9Nx7PM42Vbm10XtMXXmWrLLspACSNAJdWl/uwGkiFsTEz9mQqISetecpV 62AEMYNWqcJSJENdhgEuzVG4CaMad8qq7YU59BwaRiTUeSHRQM8t9fJd62hr2HCj3HW9 kaLg== X-Gm-Message-State: ANoB5plt+drRqCPkqOpKURTzEcWrQJFXW/oJG7m2e+hkeg94w+2/kw6i md/0gr1PfIqv20ZDd2nQK4w= X-Google-Smtp-Source: AA0mqf5PEulbt62YE3PnICeO9Ngqje1kLhmIlimqzpJM+16mQqzB5vfBBYFhApipFcj5q/Tp1FZzuw== X-Received: by 2002:a17:906:f281:b0:7ae:3b9e:1d8a with SMTP id gu1-20020a170906f28100b007ae3b9e1d8amr30675664ejb.581.1669385227901; Fri, 25 Nov 2022 06:07:07 -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 g18-20020a17090604d200b007ade5cc6e7asm907365eja.39.2022.11.25.06.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 06:07:07 -0800 (PST) Sender: Salvatore Bonaccorso Received: by eldamar.lan (Postfix, from userid 1000) id C6A11BE2EE7; Fri, 25 Nov 2022 15:07:06 +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 v2 2/4] Revert "modprobe: protect against sysctl errors" Date: Fri, 25 Nov 2022 15:06:54 +0100 Message-Id: <20221125140656.1985137-3-carnil@debian.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221125140656.1985137-1-carnil@debian.org> References: <20221125140656.1985137-1-carnil@debian.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org This reverts commit 5e60e38aa4ba251ef66610514be5f45c41519e0f. This is 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 14:06:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salvatore Bonaccorso X-Patchwork-Id: 13055981 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 62EC4C4332F for ; Fri, 25 Nov 2022 14:07:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229601AbiKYOHL (ORCPT ); Fri, 25 Nov 2022 09:07:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229648AbiKYOHK (ORCPT ); Fri, 25 Nov 2022 09:07:10 -0500 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0382C1EC43 for ; Fri, 25 Nov 2022 06:07:09 -0800 (PST) Received: by mail-ed1-x532.google.com with SMTP id e13so6533313edj.7 for ; Fri, 25 Nov 2022 06:07:08 -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=GzBphOai3x59cLnsLGgVud00By7NgbRGrVMsrTugVfnKlFdUxaxyAAk6my4jKS3GNs Fv3uzZkChmT+Tq2ws7JY2zkjGUgVrIfo3juThdX4GaLZHGi7E0ixVxAdzD11ownXIgch +J9YvgnarIc0CH2oqWta46pi7WHyduzW9JyYmKiMhDL+RmvRPKYIo3+NeOqwS6QH7l5W 58j4cZEspy2a2rh0zOvYUPYDL/KrxDGvOAgxMWmr4sNsI3oHBkPGaeuyGh7c4S8vfQRQ EjJX3cqBHiOwHORlaTn/y25JaVwSX97TqIFUxifHM0sfQqte6vpI0h0awRFP+nQV575g rR5g== 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=6zXAoANN5YEq1/b7NGo7CzJ85anag7TwFSUIZ1icm7uwccp5LZGQFbQXu6OOyGSECt ASPSbvUYJNlp2j8D/uXWf3R5B7zh7gwUIuMyhO9bGSFVZkecFTbjEPEewijW84QflXKy aLR7k6dk1k+Ns4uFFdbMezfcP5PXqZ44WtTzVGOuRzIYVeH9wJmfIEoHTUfn7G8wWqBo cXKkPhrbQZWcHsXxeR8vJxyBg/lc7I0IpbY2mi4sFw9EvB5ARqJPBkQCU0jKUiJu8I8N ubLJ6zxYf/5CJ88VDp+mcq83vUoxxIg9l+l3oedT7ILOzUsJy52NJi6jPLah0I+NXsPY e0MA== X-Gm-Message-State: ANoB5pn16azH9s/rbBvSYiwegR5oYvj1yWSVRZFmtyr1SHrVT9o4msgv HrKvyVcSYkoRyYKHfT8rvr0= X-Google-Smtp-Source: AA0mqf4UcGJG9gKObzgQ6awmRef2OrxjB/91jtWA9K93sdhQyWRUyKEdMqNeDL0rmodgnvbqtKdDoA== X-Received: by 2002:a05:6402:370e:b0:464:fa1:9dc3 with SMTP id ek14-20020a056402370e00b004640fa19dc3mr20649757edb.343.1669385228491; Fri, 25 Nov 2022 06:07:08 -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 j9-20020a1709066dc900b007ba46867e6asm1633919ejt.16.2022.11.25.06.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 06:07:08 -0800 (PST) Sender: Salvatore Bonaccorso Received: by eldamar.lan (Postfix, from userid 1000) id 71E26BE2DE0; Fri, 25 Nov 2022 15:07:07 +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 v2 3/4] Revert "systemd: Apply all sysctl settings when NFS-related modules are loaded" Date: Fri, 25 Nov 2022 15:06:55 +0100 Message-Id: <20221125140656.1985137-4-carnil@debian.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221125140656.1985137-1-carnil@debian.org> References: <20221125140656.1985137-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 14:06:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salvatore Bonaccorso X-Patchwork-Id: 13055983 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 E08CAC4332F for ; Fri, 25 Nov 2022 14:07:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229694AbiKYOHM (ORCPT ); Fri, 25 Nov 2022 09:07:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229727AbiKYOHL (ORCPT ); Fri, 25 Nov 2022 09:07:11 -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 B816A1EAFA for ; Fri, 25 Nov 2022 06:07:10 -0800 (PST) Received: by mail-ed1-x529.google.com with SMTP id z63so6555716ede.1 for ; Fri, 25 Nov 2022 06:07:10 -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=GTsWQvlEqqVwiOjKpOvkoA8zjB47gy5ea89jv3NKayE=; b=C9zUZE63kwLkbT3VfWqXZJtSdShajv4A/h5IJq2uoyjI1Y6FTbkRsyzq0ffE/zGR/J TSl4zCvBM3MS7ZCB3zrpLrUQg69ySrgQy2xsfzCIJzTIYMyoWdoXYV2Ce78FOuwxdeU+ ywAIMOQskaNqsO9u44t5mnldQJY7BePcdJf7YXi1pFQmanLbDSE2uuJqTnbksVv7w1+Q E+FAaakZCUu3JTraaugTIrsPr4hKUW979bN531LGKbPWBg1CWgV8ctMhuy9n6SdRyf9g 9hd7TTOzhfoxPXPYZzva0LXOJWndblSIU2uEIi5qo634LgONa2YUMB82A2LJ8s50eNdI qLlg== 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=GTsWQvlEqqVwiOjKpOvkoA8zjB47gy5ea89jv3NKayE=; b=OEmcxRvdTaaMl3dQub3pK3ZjcWaW6o2uqQR7NAw6apcnEph3JQvrwYN5JWg1q6fAr0 NyokNRsgtSCRVm6HnwWZgFQv2Kc8Zh17+fQ+yH4Ywtpj4n4JE8NUXM+TsRUBcjQ7Ah+0 hDasLna73zhuODt7BDeXVLGtFc8rZ5IEbP/sFJw/cr3eLzD12u7MxitvxxEBGgczxMlk N8LF8t8Ph90B9woE5ODxmdTmljpaoZKvAjcexfOLwnBX/5xiOdrMmZIFcqBBtB9Y7zKo YsHEQEylHXY48lXRlsskXfNTG4VWziDGTl+VLF3fB0I8p2k28ITZXdcrGDlTitc0rrG8 SGww== X-Gm-Message-State: ANoB5pmcefUsGeaR/CVs9p0ric5G4oXzp/7wOhyjjweoqcZHs/zjssYD NIrjp0lCElYZfj4aqFLvay4= X-Google-Smtp-Source: AA0mqf7rNZujjfrPuLW0y7ayHDpRPno6xkjvXcuThwKecvdVr9ypJLc5kuoeTxlM7tUBPAv/6A9xzg== X-Received: by 2002:a05:6402:360a:b0:469:f59f:352e with SMTP id el10-20020a056402360a00b00469f59f352emr15541686edb.241.1669385229198; Fri, 25 Nov 2022 06:07:09 -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 b7-20020a17090630c700b0077a11b79b9bsm1575728ejb.133.2022.11.25.06.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 06:07:08 -0800 (PST) Sender: Salvatore Bonaccorso Received: by eldamar.lan (Postfix, from userid 1000) id 1EE22BE2EE7; Fri, 25 Nov 2022 15:07:08 +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 v2 4/4] systemd: Apply all sysctl settings through udev rule when NFS-related modules are loaded Date: Fri, 25 Nov 2022 15:06:56 +0100 Message-Id: <20221125140656.1985137-5-carnil@debian.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221125140656.1985137-1-carnil@debian.org> References: <20221125140656.1985137-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 modules are loaded. Placing it in the systemd directory similarly as the choice 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