Message ID | a93de2e8afa826745746b00fc5f64e513df5d52f.1697104757.git.geert+renesas@glider.be |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1110639vqb; Thu, 12 Oct 2023 03:08:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5c/rnThZMVzucOr9uQzxF06HuGmbdNv8LhqFvZIqfnIMoU28DZFwEaaxWktAkG9Vk1lje X-Received: by 2002:a05:6a00:1d94:b0:690:d314:38d with SMTP id z20-20020a056a001d9400b00690d314038dmr26622801pfw.1.1697105314063; Thu, 12 Oct 2023 03:08:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697105314; cv=none; d=google.com; s=arc-20160816; b=JBfxrWU8plSNiOrTUiClk1vsV6/tR40VwFW0ztFei+087BjLChuuDQ4LPswxWNaqxb ehkE7LgdF/nQ/jk1mQ08FN4kcPVQ5tydYYAB19wjuB8DBM/sGhcloybHF7VHxdW9QU+4 s75bWsBPG63pYEGDytojd4Qgy/wSxZ6pXi0YZqk0OWMgzs+4z2qegAE1deJPnM9NuVoK 6NQjIGfRZG3EXdOKs6dtRZCwcrP/no0ga2j66b/UUkF3+hvFU/6R+A4sPyW+JAyVDhwg +tE8e2ZtuvWSQqA7X64pceAQgns7GuWJZCkRpPS0qd3CiyizFZ2+cJga3zNvqAHB8G3z n4EA== 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; bh=ANBdJxb4exC/SuZmIQRzD5eW7AMj/Ns60LRhxT1SfYk=; fh=UQBNt8qzbI9LUMF9Fa69yl3jp8HHO1Oy26uQBA7jD1M=; b=I+OYEm8RLGDQKyHfU1xXdqRW5Bozp9lwzDQ8ltwoePTVqvuW9CROo+Wa5DvECwCRvH G8xU5NgTZKp3rNi4xBIN8GXaM22SDX21gb2RiWVIEzweXlsf+LhvUbPAMuGH53cVK+26 WiE5zP5wIVKYWzzfVncG0ZY9pg0qauvXlyTrxo/sW/h1e9wHks6D4fZBYMGjULsrGGZ0 +/vuzsQSD8ExjN7Tu5k52z9qcjtKlbzmCruywS9BiyBsbZJruTUgWlvXnV1ppckcYeE6 8oWtjd2lU/UJ9rDGMwl8zd5fv0EyVGPSZH/GVCWfBtIzrR2NmZrYZGlPb2AjnLEnwTqY 813w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id k9-20020a056a00168900b0069342aef90bsi14577985pfc.3.2023.10.12.03.08.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 03:08:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id BCB9F818BCB9; Thu, 12 Oct 2023 03:08:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235638AbjJLKIS (ORCPT <rfc822;rua109.linux@gmail.com> + 19 others); Thu, 12 Oct 2023 06:08:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234179AbjJLKIQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 12 Oct 2023 06:08:16 -0400 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7CECA9 for <linux-kernel@vger.kernel.org>; Thu, 12 Oct 2023 03:08:13 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:b72e:818:7fe2:593d]) by albert.telenet-ops.be with bizsmtp id wy872A00A56sUls06y87rb; Thu, 12 Oct 2023 12:08:10 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from <geert@linux-m68k.org>) id 1qqsbs-0068cO-Ox; Thu, 12 Oct 2023 12:08:07 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from <geert@linux-m68k.org>) id 1qqsbv-001VAj-0c; Thu, 12 Oct 2023 12:08:07 +0200 From: Geert Uytterhoeven <geert+renesas@glider.be> To: Chuck Lever <chuck.lever@oracle.com>, Jeff Layton <jlayton@kernel.org>, Neil Brown <neilb@suse.de>, Olga Kornievskaia <kolga@netapp.com>, Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>, Trond Myklebust <trond.myklebust@hammerspace.com>, Anna Schumaker <anna@kernel.org> Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven <geert+renesas@glider.be> Subject: [PATCH -next v2] sunrpc: Use no_printk() in dfprintk*() dummies Date: Thu, 12 Oct 2023 12:08:05 +0200 Message-Id: <a93de2e8afa826745746b00fc5f64e513df5d52f.1697104757.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 12 Oct 2023 03:08:31 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779543901714638950 X-GMAIL-MSGID: 1779543901714638950 |
Series |
[-next,v2] sunrpc: Use no_printk() in dfprintk*() dummies
|
|
Commit Message
Geert Uytterhoeven
Oct. 12, 2023, 10:08 a.m. UTC
When building NFS with W=1 and CONFIG_WERROR=y, but
CONFIG_SUNRPC_DEBUG=n:
fs/nfs/nfs4proc.c: In function ‘nfs4_proc_create_session’:
fs/nfs/nfs4proc.c:9276:19: error: variable ‘ptr’ set but not used [-Werror=unused-but-set-variable]
9276 | unsigned *ptr;
| ^~~
CC fs/nfs/callback.o
fs/nfs/callback.c: In function ‘nfs41_callback_svc’:
fs/nfs/callback.c:98:13: error: variable ‘error’ set but not used [-Werror=unused-but-set-variable]
98 | int error;
| ^~~~~
CC fs/nfs/flexfilelayout/flexfilelayout.o
fs/nfs/flexfilelayout/flexfilelayout.c: In function ‘ff_layout_io_track_ds_error’:
fs/nfs/flexfilelayout/flexfilelayout.c:1230:13: error: variable ‘err’ set but not used [-Werror=unused-but-set-variable]
1230 | int err;
| ^~~
CC fs/nfs/flexfilelayout/flexfilelayoutdev.o
fs/nfs/flexfilelayout/flexfilelayoutdev.c: In function ‘nfs4_ff_alloc_deviceid_node’:
fs/nfs/flexfilelayout/flexfilelayoutdev.c:55:16: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable]
55 | int i, ret = -ENOMEM;
| ^~~
All these are due to variables that are set unconditionally, but are
used only when debugging is enabled.
Fix this by changing the dfprintk*() dummy macros from empty loops to
calls to the no_printk() helper. This informs the compiler that the
passed debug parameters are actually used, and enables format specifier
checking as a bonus.
This requires removing the protection by CONFIG_SUNRPC_DEBUG of the
declaration of nlmdbg_cookie2a(), as its reference is now visible to the
compiler, but optimized away.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v2:
- s/uncontionally/unconditionally/,
- Drop CONFIG_SUNRPC_DEBUG check in fs/lockd/svclock.c to fix build
failure.
---
fs/lockd/svclock.c | 2 --
include/linux/sunrpc/debug.h | 6 +++---
2 files changed, 3 insertions(+), 5 deletions(-)
Comments
On Thu, 2023-10-12 at 12:08 +0200, Geert Uytterhoeven wrote: > When building NFS with W=1 and CONFIG_WERROR=y, but > CONFIG_SUNRPC_DEBUG=n: > > fs/nfs/nfs4proc.c: In function ‘nfs4_proc_create_session’: > fs/nfs/nfs4proc.c:9276:19: error: variable ‘ptr’ set but not used [-Werror=unused-but-set-variable] > 9276 | unsigned *ptr; > | ^~~ > CC fs/nfs/callback.o > fs/nfs/callback.c: In function ‘nfs41_callback_svc’: > fs/nfs/callback.c:98:13: error: variable ‘error’ set but not used [-Werror=unused-but-set-variable] > 98 | int error; > | ^~~~~ > CC fs/nfs/flexfilelayout/flexfilelayout.o > fs/nfs/flexfilelayout/flexfilelayout.c: In function ‘ff_layout_io_track_ds_error’: > fs/nfs/flexfilelayout/flexfilelayout.c:1230:13: error: variable ‘err’ set but not used [-Werror=unused-but-set-variable] > 1230 | int err; > | ^~~ > CC fs/nfs/flexfilelayout/flexfilelayoutdev.o > fs/nfs/flexfilelayout/flexfilelayoutdev.c: In function ‘nfs4_ff_alloc_deviceid_node’: > fs/nfs/flexfilelayout/flexfilelayoutdev.c:55:16: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable] > 55 | int i, ret = -ENOMEM; > | ^~~ > > All these are due to variables that are set unconditionally, but are > used only when debugging is enabled. > > Fix this by changing the dfprintk*() dummy macros from empty loops to > calls to the no_printk() helper. This informs the compiler that the > passed debug parameters are actually used, and enables format specifier > checking as a bonus. > > This requires removing the protection by CONFIG_SUNRPC_DEBUG of the > declaration of nlmdbg_cookie2a(), as its reference is now visible to the > compiler, but optimized away. > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > --- > v2: > - s/uncontionally/unconditionally/, > - Drop CONFIG_SUNRPC_DEBUG check in fs/lockd/svclock.c to fix build > failure. > --- > fs/lockd/svclock.c | 2 -- > include/linux/sunrpc/debug.h | 6 +++--- > 2 files changed, 3 insertions(+), 5 deletions(-) > > diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c > index 43aeba9de55cbbc5..119a0c31d30eed4f 100644 > --- a/fs/lockd/svclock.c > +++ b/fs/lockd/svclock.c > @@ -55,7 +55,6 @@ static const struct rpc_call_ops nlmsvc_grant_ops; > static LIST_HEAD(nlm_blocked); > static DEFINE_SPINLOCK(nlm_blocked_lock); > > -#if IS_ENABLED(CONFIG_SUNRPC_DEBUG) > static const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie) > { > /* > @@ -82,7 +81,6 @@ static const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie) > > return buf; > } > -#endif > > /* > * Insert a blocked lock into the global list > diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h > index f6aeed07fe04e3d5..76539c6673f2fb15 100644 > --- a/include/linux/sunrpc/debug.h > +++ b/include/linux/sunrpc/debug.h > @@ -67,9 +67,9 @@ do { \ > # define RPC_IFDEBUG(x) x > #else > # define ifdebug(fac) if (0) > -# define dfprintk(fac, fmt, ...) do {} while (0) > -# define dfprintk_cont(fac, fmt, ...) do {} while (0) > -# define dfprintk_rcu(fac, fmt, ...) do {} while (0) > +# define dfprintk(fac, fmt, ...) no_printk(fmt, ##__VA_ARGS__) > +# define dfprintk_cont(fac, fmt, ...) no_printk(fmt, ##__VA_ARGS__) > +# define dfprintk_rcu(fac, fmt, ...) no_printk(fmt, ##__VA_ARGS__) > # define RPC_IFDEBUG(x) > #endif > Acked-by: Jeff Layton <jlayton@kernel.org>
On Thu, Oct 12, 2023 at 12:08 PM Geert Uytterhoeven <geert+renesas@glider.be> wrote: > When building NFS with W=1 and CONFIG_WERROR=y, but > CONFIG_SUNRPC_DEBUG=n: > > fs/nfs/nfs4proc.c: In function ‘nfs4_proc_create_session’: > fs/nfs/nfs4proc.c:9276:19: error: variable ‘ptr’ set but not used [-Werror=unused-but-set-variable] > 9276 | unsigned *ptr; > | ^~~ > CC fs/nfs/callback.o > fs/nfs/callback.c: In function ‘nfs41_callback_svc’: > fs/nfs/callback.c:98:13: error: variable ‘error’ set but not used [-Werror=unused-but-set-variable] > 98 | int error; > | ^~~~~ > CC fs/nfs/flexfilelayout/flexfilelayout.o > fs/nfs/flexfilelayout/flexfilelayout.c: In function ‘ff_layout_io_track_ds_error’: > fs/nfs/flexfilelayout/flexfilelayout.c:1230:13: error: variable ‘err’ set but not used [-Werror=unused-but-set-variable] > 1230 | int err; > | ^~~ > CC fs/nfs/flexfilelayout/flexfilelayoutdev.o > fs/nfs/flexfilelayout/flexfilelayoutdev.c: In function ‘nfs4_ff_alloc_deviceid_node’: > fs/nfs/flexfilelayout/flexfilelayoutdev.c:55:16: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable] > 55 | int i, ret = -ENOMEM; > | ^~~ > > All these are due to variables that are set unconditionally, but are > used only when debugging is enabled. > > Fix this by changing the dfprintk*() dummy macros from empty loops to > calls to the no_printk() helper. This informs the compiler that the > passed debug parameters are actually used, and enables format specifier > checking as a bonus. > > This requires removing the protection by CONFIG_SUNRPC_DEBUG of the > declaration of nlmdbg_cookie2a(), as its reference is now visible to the > compiler, but optimized away. > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > --- > v2: > - s/uncontionally/unconditionally/, > - Drop CONFIG_SUNRPC_DEBUG check in fs/lockd/svclock.c to fix build > failure. The robots pointed out a second build failure, which is not fixed by this v2: https://lore.kernel.org/all/202310121759.0CF34DcN-lkp@intel.com/ Gr{oetje,eeting}s, Geert
Hi Geert,
kernel test robot noticed the following build errors:
[auto build test ERROR on next-20231016]
url: https://github.com/intel-lab-lkp/linux/commits/Geert-Uytterhoeven/sunrpc-Use-no_printk-in-dfprintk-dummies/20231017-104813
base: next-20231016
patch link: https://lore.kernel.org/r/a93de2e8afa826745746b00fc5f64e513df5d52f.1697104757.git.geert%2Brenesas%40glider.be
patch subject: [PATCH -next v2] sunrpc: Use no_printk() in dfprintk*() dummies
config: x86_64-rhel-8.3 (https://download.01.org/0day-ci/archive/20231020/202310200734.I6x6UCe1-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231020/202310200734.I6x6UCe1-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310200734.I6x6UCe1-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/linux/kernel.h:31,
from arch/x86/include/asm/percpu.h:27,
from arch/x86/include/asm/current.h:10,
from include/linux/sched.h:12,
from include/linux/sunrpc/svcauth_gss.h:12,
from fs/nfsd/nfsfh.c:13:
fs/nfsd/nfsfh.c: In function 'nfsd_setuser_and_check_port':
>> fs/nfsd/nfsfh.c:111:47: error: 'buf' undeclared (first use in this function)
111 | svc_print_addr(rqstp, buf, sizeof(buf)));
| ^~~
include/linux/printk.h:427:33: note: in definition of macro 'printk_index_wrap'
427 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/printk.h:129:17: note: in expansion of macro 'printk'
129 | printk(fmt, ##__VA_ARGS__); \
| ^~~~~~
include/linux/sunrpc/debug.h:70:41: note: in expansion of macro 'no_printk'
70 | # define dfprintk(fac, fmt, ...) no_printk(fmt, ##__VA_ARGS__)
| ^~~~~~~~~
include/linux/sunrpc/debug.h:25:9: note: in expansion of macro 'dfprintk'
25 | dfprintk(FACILITY, fmt, ##__VA_ARGS__)
| ^~~~~~~~
fs/nfsd/nfsfh.c:110:17: note: in expansion of macro 'dprintk'
110 | dprintk("nfsd: request from insecure port %s!\n",
| ^~~~~~~
fs/nfsd/nfsfh.c:111:47: note: each undeclared identifier is reported only once for each function it appears in
111 | svc_print_addr(rqstp, buf, sizeof(buf)));
| ^~~
include/linux/printk.h:427:33: note: in definition of macro 'printk_index_wrap'
427 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/printk.h:129:17: note: in expansion of macro 'printk'
129 | printk(fmt, ##__VA_ARGS__); \
| ^~~~~~
include/linux/sunrpc/debug.h:70:41: note: in expansion of macro 'no_printk'
70 | # define dfprintk(fac, fmt, ...) no_printk(fmt, ##__VA_ARGS__)
| ^~~~~~~~~
include/linux/sunrpc/debug.h:25:9: note: in expansion of macro 'dfprintk'
25 | dfprintk(FACILITY, fmt, ##__VA_ARGS__)
| ^~~~~~~~
fs/nfsd/nfsfh.c:110:17: note: in expansion of macro 'dprintk'
110 | dprintk("nfsd: request from insecure port %s!\n",
| ^~~~~~~
vim +/buf +111 fs/nfsd/nfsfh.c
9d7ed1355db5b0 J. Bruce Fields 2018-03-08 101
6fa02839bf9412 J. Bruce Fields 2007-11-12 102 static __be32 nfsd_setuser_and_check_port(struct svc_rqst *rqstp,
6fa02839bf9412 J. Bruce Fields 2007-11-12 103 struct svc_export *exp)
6fa02839bf9412 J. Bruce Fields 2007-11-12 104 {
12045a6ee9908b J. Bruce Fields 2009-12-08 105 int flags = nfsexp_flags(rqstp, exp);
12045a6ee9908b J. Bruce Fields 2009-12-08 106
6fa02839bf9412 J. Bruce Fields 2007-11-12 107 /* Check if the request originated from a secure port. */
9d7ed1355db5b0 J. Bruce Fields 2018-03-08 108 if (!nfsd_originating_port_ok(rqstp, flags)) {
5216a8e70e25b0 Pavel Emelyanov 2008-02-21 109 RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
a48fd0f9f77b6e Kinglong Mee 2014-05-29 110 dprintk("nfsd: request from insecure port %s!\n",
6fa02839bf9412 J. Bruce Fields 2007-11-12 @111 svc_print_addr(rqstp, buf, sizeof(buf)));
6fa02839bf9412 J. Bruce Fields 2007-11-12 112 return nfserr_perm;
6fa02839bf9412 J. Bruce Fields 2007-11-12 113 }
6fa02839bf9412 J. Bruce Fields 2007-11-12 114
6fa02839bf9412 J. Bruce Fields 2007-11-12 115 /* Set user creds for this exportpoint */
6fa02839bf9412 J. Bruce Fields 2007-11-12 116 return nfserrno(nfsd_setuser(rqstp, exp));
6fa02839bf9412 J. Bruce Fields 2007-11-12 117 }
6fa02839bf9412 J. Bruce Fields 2007-11-12 118
Hi Geert,
kernel test robot noticed the following build errors:
[auto build test ERROR on next-20231016]
url: https://github.com/intel-lab-lkp/linux/commits/Geert-Uytterhoeven/sunrpc-Use-no_printk-in-dfprintk-dummies/20231017-104813
base: next-20231016
patch link: https://lore.kernel.org/r/a93de2e8afa826745746b00fc5f64e513df5d52f.1697104757.git.geert%2Brenesas%40glider.be
patch subject: [PATCH -next v2] sunrpc: Use no_printk() in dfprintk*() dummies
config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20231020/202310200948.TK9Y6iGy-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231020/202310200948.TK9Y6iGy-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310200948.TK9Y6iGy-lkp@intel.com/
All errors (new ones prefixed by >>):
>> fs/nfsd/nfsfh.c:111:45: error: use of undeclared identifier 'buf'
svc_print_addr(rqstp, buf, sizeof(buf)));
^
fs/nfsd/nfsfh.c:111:33: error: use of undeclared identifier 'buf'
svc_print_addr(rqstp, buf, sizeof(buf)));
^
2 errors generated.
vim +/buf +111 fs/nfsd/nfsfh.c
9d7ed1355db5b00 J. Bruce Fields 2018-03-08 101
6fa02839bf9412e J. Bruce Fields 2007-11-12 102 static __be32 nfsd_setuser_and_check_port(struct svc_rqst *rqstp,
6fa02839bf9412e J. Bruce Fields 2007-11-12 103 struct svc_export *exp)
6fa02839bf9412e J. Bruce Fields 2007-11-12 104 {
12045a6ee9908b3 J. Bruce Fields 2009-12-08 105 int flags = nfsexp_flags(rqstp, exp);
12045a6ee9908b3 J. Bruce Fields 2009-12-08 106
6fa02839bf9412e J. Bruce Fields 2007-11-12 107 /* Check if the request originated from a secure port. */
9d7ed1355db5b00 J. Bruce Fields 2018-03-08 108 if (!nfsd_originating_port_ok(rqstp, flags)) {
5216a8e70e25b01 Pavel Emelyanov 2008-02-21 109 RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
a48fd0f9f77b6e1 Kinglong Mee 2014-05-29 110 dprintk("nfsd: request from insecure port %s!\n",
6fa02839bf9412e J. Bruce Fields 2007-11-12 @111 svc_print_addr(rqstp, buf, sizeof(buf)));
6fa02839bf9412e J. Bruce Fields 2007-11-12 112 return nfserr_perm;
6fa02839bf9412e J. Bruce Fields 2007-11-12 113 }
6fa02839bf9412e J. Bruce Fields 2007-11-12 114
6fa02839bf9412e J. Bruce Fields 2007-11-12 115 /* Set user creds for this exportpoint */
6fa02839bf9412e J. Bruce Fields 2007-11-12 116 return nfserrno(nfsd_setuser(rqstp, exp));
6fa02839bf9412e J. Bruce Fields 2007-11-12 117 }
6fa02839bf9412e J. Bruce Fields 2007-11-12 118
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index 43aeba9de55cbbc5..119a0c31d30eed4f 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c @@ -55,7 +55,6 @@ static const struct rpc_call_ops nlmsvc_grant_ops; static LIST_HEAD(nlm_blocked); static DEFINE_SPINLOCK(nlm_blocked_lock); -#if IS_ENABLED(CONFIG_SUNRPC_DEBUG) static const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie) { /* @@ -82,7 +81,6 @@ static const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie) return buf; } -#endif /* * Insert a blocked lock into the global list diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index f6aeed07fe04e3d5..76539c6673f2fb15 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h @@ -67,9 +67,9 @@ do { \ # define RPC_IFDEBUG(x) x #else # define ifdebug(fac) if (0) -# define dfprintk(fac, fmt, ...) do {} while (0) -# define dfprintk_cont(fac, fmt, ...) do {} while (0) -# define dfprintk_rcu(fac, fmt, ...) do {} while (0) +# define dfprintk(fac, fmt, ...) no_printk(fmt, ##__VA_ARGS__) +# define dfprintk_cont(fac, fmt, ...) no_printk(fmt, ##__VA_ARGS__) +# define dfprintk_rcu(fac, fmt, ...) no_printk(fmt, ##__VA_ARGS__) # define RPC_IFDEBUG(x) #endif