Re: [PATCH] exportfs: use pr_debug for unreachable debug statements
From: Chuck Lever III <chuck.lever@oracle.com>
Date: 2022-10-24 20:49:48
On Oct 23, 2022, at 6:11 PM, NeilBrown [off-list ref] wrote: On Fri, 21 Oct 2022, David Disseldorp wrote:quoted
expfs.c has a bunch of dprintk statements which are unusable due to: #define dprintk(fmt, args...) do{}while(0) Use pr_debug so that they can be enabled dynamically. Also make some minor changes to the debug statements to fix some incorrect types, and remove __func__ which can be handled by dynamic debug separately. Signed-off-by: David Disseldorp <redacted>Reviewed-by: NeilBrown <redacted> Thanks, NeilBrown
I don't think we're the maintainers of expfs.c ? $ scripts/get_maintainer.pl fs/exportfs/expfs.c Christian Brauner [off-list ref] (commit_signer:2/2=100%,authored:1/2=50%,added_lines:3/6=50%,removed_lines:2/6=33%) Al Viro [off-list ref] (commit_signer:1/2=50%,authored:1/2=50%,added_lines:3/6=50%,removed_lines:4/6=67%) Miklos Szeredi [off-list ref] (commit_signer:1/2=50%) Amir Goldstein [off-list ref] (commit_signer:1/2=50%) linux-kernel@vger.kernel.org (open list) But maybe MAINTAINERS needs to be fixed. There's no entry there for fs/exportfs.
quoted
--- fs/exportfs/expfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c index c648a493faf23..3204bd33e4e8a 100644 --- a/fs/exportfs/expfs.c +++ b/fs/exportfs/expfs.c@@ -18,7 +18,7 @@#include <linux/sched.h> #include <linux/cred.h> -#define dprintk(fmt, args...) do{}while(0) +#define dprintk(fmt, args...) pr_debug(fmt, ##args) static int get_name(const struct path *path, char *name, struct dentry *child);@@ -132,8 +132,8 @@ static struct dentry *reconnect_one(struct vfsmount *mnt,inode_unlock(dentry->d_inode); if (IS_ERR(parent)) { - dprintk("%s: get_parent of %ld failed, err %d\n", - __func__, dentry->d_inode->i_ino, PTR_ERR(parent)); + dprintk("get_parent of %lu failed, err %ld\n", + dentry->d_inode->i_ino, PTR_ERR(parent)); return parent; }@@ -147,7 +147,7 @@ static struct dentry *reconnect_one(struct vfsmount *mnt,dprintk("%s: found name: %s\n", __func__, nbuf); tmp = lookup_one_unlocked(mnt_user_ns(mnt), nbuf, parent, strlen(nbuf)); if (IS_ERR(tmp)) { - dprintk("%s: lookup failed: %d\n", __func__, PTR_ERR(tmp)); + dprintk("lookup failed: %ld\n", PTR_ERR(tmp)); err = PTR_ERR(tmp); goto out_err; } -- 2.35.3
-- Chuck Lever