linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] autofs - fix log print messages
@ 2014-11-11  1:29 Ian Kent
  2014-11-11  1:30 ` [PATCH 2/3] autofs - change log prints to not insert newline Ian Kent
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Ian Kent @ 2014-11-11  1:29 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Joe Perches, linux-fsdevel, autofs mailing list, Kernel Mailing List

Fix some inconsistencies in log print output and ensure that
the module name is included in all log prints.

Signed-off-by: Ian Kent <raven@themaw.net>
Cc: Joe Perches <joe@perches.com>
---
 fs/autofs/autofs_i.h  |    6 +++---
 fs/autofs/dev-ioctl.c |    2 +-
 fs/autofs/inode.c     |   10 +++++-----
 fs/autofs/waitq.c     |    4 ++--
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/fs/autofs/autofs_i.h b/fs/autofs/autofs_i.h
index e99a675..fd93fdc 100644
--- a/fs/autofs/autofs_i.h
+++ b/fs/autofs/autofs_i.h
@@ -37,15 +37,15 @@
 /* #define DEBUG */
 
 #define DPRINTK(fmt, ...)				\
-	pr_debug("pid %d: %s: " fmt "\n",		\
+	pr_debug(KBUILD_MODNAME ":pid:%d:%s: " fmt "\n",\
 		current->pid, __func__, ##__VA_ARGS__)
 
 #define AUTOFS_WARN(fmt, ...)				\
-	pr_warn("pid %d: %s: " fmt "\n",	\
+	pr_warn(KBUILD_MODNAME ":pid:%d:%s: " fmt "\n",	\
 		current->pid, __func__, ##__VA_ARGS__)
 
 #define AUTOFS_ERROR(fmt, ...)				\
-	pr_err("pid %d: %s: " fmt "\n",	\
+	pr_err(KBUILD_MODNAME ":pid:%d:%s: " fmt "\n",	\
 		current->pid, __func__, ##__VA_ARGS__)
 
 /*
diff --git a/fs/autofs/dev-ioctl.c b/fs/autofs/dev-ioctl.c
index 34e515b..eb16fe4 100644
--- a/fs/autofs/dev-ioctl.c
+++ b/fs/autofs/dev-ioctl.c
@@ -369,7 +369,7 @@ static int autofs_dev_ioctl_setpipefd(struct file *fp,
 		new_pid = get_task_pid(current, PIDTYPE_PGID);
 
 		if (ns_of_pid(new_pid) != ns_of_pid(sbi->oz_pgrp)) {
-			AUTOFS_WARN("Not allowed to change PID namespace");
+			AUTOFS_WARN("not allowed to change PID namespace");
 			err = -EINVAL;
 			goto out;
 		}
diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c
index 01788cc..5012f21 100644
--- a/fs/autofs/inode.c
+++ b/fs/autofs/inode.c
@@ -266,14 +266,14 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
 	if (parse_options(data, &pipefd, &root_inode->i_uid, &root_inode->i_gid,
 			  &pgrp, &pgrp_set, &sbi->type, &sbi->min_proto,
 			  &sbi->max_proto)) {
-		AUTOFS_ERROR("autofs: called with bogus options");
+		AUTOFS_ERROR("called with bogus options");
 		goto fail_dput;
 	}
 
 	if (pgrp_set) {
 		sbi->oz_pgrp = find_get_pid(pgrp);
 		if (!sbi->oz_pgrp) {
-			AUTOFS_ERROR("autofs: could not find process group %d",
+			AUTOFS_ERROR("could not find process group %d",
 				pgrp);
 			goto fail_dput;
 		}
@@ -290,7 +290,7 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
 	/* Couldn't this be tested earlier? */
 	if (sbi->max_proto < AUTOFS_MIN_PROTO_VERSION ||
 	    sbi->min_proto > AUTOFS_MAX_PROTO_VERSION) {
-		AUTOFS_ERROR("autofs: kernel does not match daemon version "
+		AUTOFS_ERROR("kernel does not match daemon version "
 			     "daemon (%d, %d) kernel (%d, %d)",
 			sbi->min_proto, sbi->max_proto,
 			AUTOFS_MIN_PROTO_VERSION, AUTOFS_MAX_PROTO_VERSION);
@@ -308,7 +308,7 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
 	pipe = fget(pipefd);
 
 	if (!pipe) {
-		AUTOFS_ERROR("autofs: could not open pipe file descriptor");
+		AUTOFS_ERROR("could not open pipe file descriptor");
 		goto fail_dput;
 	}
 	ret = autofs_prepare_pipe(pipe);
@@ -329,7 +329,7 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
 	 */
 fail_fput:
 	AUTOFS_ERROR(
-		"autofs: pipe file descriptor does not contain proper ops");
+		"pipe file descriptor does not contain proper ops");
 	fput(pipe);
 	/* fall through */
 fail_dput:
diff --git a/fs/autofs/waitq.c b/fs/autofs/waitq.c
index ec0c60f..0fb2791 100644
--- a/fs/autofs/waitq.c
+++ b/fs/autofs/waitq.c
@@ -162,7 +162,7 @@ static void autofs_notify_daemon(struct autofs_sb_info *sbi,
 		break;
 	}
 	default:
-		AUTOFS_WARN("autofs_notify_daemon: bad type %d!", type);
+		AUTOFS_WARN("bad type %d!", type);
 		mutex_unlock(&sbi->wq_mutex);
 		return;
 	}
@@ -450,7 +450,7 @@ int autofs_wait(struct autofs_sb_info *sbi,
 					autofs_ptype_expire_indirect;
 		}
 
-		DPRINTK("new wait id = 0x%08lx, name = %.*s, nfy=%d\n",
+		DPRINTK("new wait id = 0x%08lx, name = %.*s, nfy=%d",
 			(unsigned long) wq->wait_queue_token, wq->name.len,
 			wq->name.name, notify);
 


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/3] autofs - change log prints to not insert newline
  2014-11-11  1:29 [PATCH 1/3] autofs - fix log print messages Ian Kent
@ 2014-11-11  1:30 ` Ian Kent
  2014-11-11  1:30 ` [PATCH 3/3] autofs - use pr_xxx() calls directly for logging Ian Kent
  2014-11-11  3:25 ` [PATCH 1/3] autofs - fix log print messages Joe Perches
  2 siblings, 0 replies; 11+ messages in thread
From: Ian Kent @ 2014-11-11  1:30 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Joe Perches, linux-fsdevel, autofs mailing list, Kernel Mailing List

Common kernel coding practice is to include the newline of log
prints within the log text rather than hidden away in a macro.

To avoid introducing inconsistencies as changes are made change
the log macros to not include the newline.

Signed-off-by: Ian Kent <raven@themaw.net>
Cc: Joe Perches <joe@perches.com>
---
 fs/autofs/autofs_i.h  |    6 +++---
 fs/autofs/dev-ioctl.c |   14 +++++++-------
 fs/autofs/expire.c    |   24 ++++++++++++------------
 fs/autofs/inode.c     |   16 ++++++++--------
 fs/autofs/root.c      |   26 +++++++++++++-------------
 fs/autofs/waitq.c     |   10 +++++-----
 6 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/fs/autofs/autofs_i.h b/fs/autofs/autofs_i.h
index fd93fdc..84d5060 100644
--- a/fs/autofs/autofs_i.h
+++ b/fs/autofs/autofs_i.h
@@ -37,15 +37,15 @@
 /* #define DEBUG */
 
 #define DPRINTK(fmt, ...)				\
-	pr_debug(KBUILD_MODNAME ":pid:%d:%s: " fmt "\n",\
+	pr_debug(KBUILD_MODNAME ":pid:%d:%s: " fmt,	\
 		current->pid, __func__, ##__VA_ARGS__)
 
 #define AUTOFS_WARN(fmt, ...)				\
-	pr_warn(KBUILD_MODNAME ":pid:%d:%s: " fmt "\n",	\
+	pr_warn(KBUILD_MODNAME ":pid:%d:%s: " fmt,	\
 		current->pid, __func__, ##__VA_ARGS__)
 
 #define AUTOFS_ERROR(fmt, ...)				\
-	pr_err(KBUILD_MODNAME ":pid:%d:%s: " fmt "\n",	\
+	pr_err(KBUILD_MODNAME ":pid:%d:%s: " fmt,	\
 		current->pid, __func__, ##__VA_ARGS__)
 
 /*
diff --git a/fs/autofs/dev-ioctl.c b/fs/autofs/dev-ioctl.c
index eb16fe4..15ce91b 100644
--- a/fs/autofs/dev-ioctl.c
+++ b/fs/autofs/dev-ioctl.c
@@ -75,7 +75,7 @@ static int check_dev_ioctl_version(int cmd, struct autofs_dev_ioctl *param)
 	if ((AUTOFS_DEV_IOCTL_VERSION_MAJOR != param->ver_major) ||
 	    (AUTOFS_DEV_IOCTL_VERSION_MINOR < param->ver_minor)) {
 		AUTOFS_WARN("ioctl control interface version mismatch: "
-		     "kernel(%u.%u), user(%u.%u), cmd(%d)",
+		     "kernel(%u.%u), user(%u.%u), cmd(%d)\n",
 		     AUTOFS_DEV_IOCTL_VERSION_MAJOR,
 		     AUTOFS_DEV_IOCTL_VERSION_MINOR,
 		     param->ver_major, param->ver_minor, cmd);
@@ -126,7 +126,7 @@ static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param)
 	err = check_dev_ioctl_version(cmd, param);
 	if (err) {
 		AUTOFS_WARN("invalid device control module version "
-		     "supplied for cmd(0x%08x)", cmd);
+		     "supplied for cmd(0x%08x)\n", cmd);
 		goto out;
 	}
 
@@ -134,14 +134,14 @@ static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param)
 		err = invalid_str(param->path, param->size - sizeof(*param));
 		if (err) {
 			AUTOFS_WARN(
-			  "path string terminator missing for cmd(0x%08x)",
+			  "path string terminator missing for cmd(0x%08x)\n",
 			  cmd);
 			goto out;
 		}
 
 		err = check_name(param->path);
 		if (err) {
-			AUTOFS_WARN("invalid path supplied for cmd(0x%08x)",
+			AUTOFS_WARN("invalid path supplied for cmd(0x%08x)\n",
 				    cmd);
 			goto out;
 		}
@@ -369,7 +369,7 @@ static int autofs_dev_ioctl_setpipefd(struct file *fp,
 		new_pid = get_task_pid(current, PIDTYPE_PGID);
 
 		if (ns_of_pid(new_pid) != ns_of_pid(sbi->oz_pgrp)) {
-			AUTOFS_WARN("not allowed to change PID namespace");
+			AUTOFS_WARN("not allowed to change PID namespace\n");
 			err = -EINVAL;
 			goto out;
 		}
@@ -657,7 +657,7 @@ static int _autofs_dev_ioctl(unsigned int command,
 
 	fn = lookup_dev_ioctl(cmd);
 	if (!fn) {
-		AUTOFS_WARN("unknown command 0x%08x", command);
+		AUTOFS_WARN("unknown command 0x%08x\n", command);
 		return -ENOTTY;
 	}
 
@@ -750,7 +750,7 @@ int __init autofs_dev_ioctl_init(void)
 
 	r = misc_register(&_autofs_dev_ioctl_misc);
 	if (r) {
-		AUTOFS_ERROR("misc_register failed for control device");
+		AUTOFS_ERROR("misc_register failed for control device\n");
 		return r;
 	}
 
diff --git a/fs/autofs/expire.c b/fs/autofs/expire.c
index c3090b4..99f51cf 100644
--- a/fs/autofs/expire.c
+++ b/fs/autofs/expire.c
@@ -38,7 +38,7 @@ static int autofs_mount_busy(struct vfsmount *mnt, struct dentry *dentry)
 	struct path path = {.mnt = mnt, .dentry = dentry};
 	int status = 1;
 
-	DPRINTK("dentry %p %.*s",
+	DPRINTK("dentry %p %.*s\n",
 		dentry, (int)dentry->d_name.len, dentry->d_name.name);
 
 	path_get(&path);
@@ -65,7 +65,7 @@ static int autofs_mount_busy(struct vfsmount *mnt, struct dentry *dentry)
 
 	status = 0;
 done:
-	DPRINTK("returning = %d", status);
+	DPRINTK("returning = %d\n", status);
 	path_put(&path);
 	return status;
 }
@@ -191,7 +191,7 @@ static int autofs_direct_busy(struct vfsmount *mnt,
 			      unsigned long timeout,
 			      int do_now)
 {
-	DPRINTK("top %p %.*s",
+	DPRINTK("top %p %.*s\n",
 		top, (int) top->d_name.len, top->d_name.name);
 
 	/* If it's busy update the expiry counters */
@@ -223,7 +223,7 @@ static int autofs_tree_busy(struct vfsmount *mnt,
 	struct autofs_info *top_ino = autofs_dentry_ino(top);
 	struct dentry *p;
 
-	DPRINTK("top %p %.*s",
+	DPRINTK("top %p %.*s\n",
 		top, (int)top->d_name.len, top->d_name.name);
 
 	/* Negative dentry - give up */
@@ -232,7 +232,7 @@ static int autofs_tree_busy(struct vfsmount *mnt,
 
 	p = NULL;
 	while ((p = get_next_positive_dentry(p, top))) {
-		DPRINTK("dentry %p %.*s",
+		DPRINTK("dentry %p %.*s\n",
 			p, (int) p->d_name.len, p->d_name.name);
 
 		/*
@@ -279,12 +279,12 @@ static struct dentry *autofs_check_leaves(struct vfsmount *mnt,
 {
 	struct dentry *p;
 
-	DPRINTK("parent %p %.*s",
+	DPRINTK("parent %p %.*s\n",
 		parent, (int)parent->d_name.len, parent->d_name.name);
 
 	p = NULL;
 	while ((p = get_next_positive_dentry(p, parent))) {
-		DPRINTK("dentry %p %.*s",
+		DPRINTK("dentry %p %.*s\n",
 			p, (int) p->d_name.len, p->d_name.name);
 
 		if (d_mountpoint(p)) {
@@ -370,7 +370,7 @@ static struct dentry *should_expire(struct dentry *dentry,
 	 *	   offset (autofs-5.0+).
 	 */
 	if (d_mountpoint(dentry)) {
-		DPRINTK("checking mountpoint %p %.*s", dentry,
+		DPRINTK("checking mountpoint %p %.*s\n", dentry,
 			(int) dentry->d_name.len, dentry->d_name.name);
 
 		/* Can we umount this guy */
@@ -384,7 +384,7 @@ static struct dentry *should_expire(struct dentry *dentry,
 	}
 
 	if (dentry->d_inode && S_ISLNK(dentry->d_inode->i_mode)) {
-		DPRINTK("checking symlink %p %.*s",
+		DPRINTK("checking symlink %p %.*s\n",
 			dentry, (int)dentry->d_name.len, dentry->d_name.name);
 		/*
 		 * A symlink can't be "busy" in the usual sense so
@@ -482,7 +482,7 @@ struct dentry *autofs_expire_indirect(struct super_block *sb,
 	return NULL;
 
 found:
-	DPRINTK("returning %p %.*s",
+	DPRINTK("returning %p %.*s\n",
 		expired, (int)expired->d_name.len, expired->d_name.name);
 	ino->flags |= AUTOFS_INF_EXPIRING;
 	smp_mb();
@@ -515,13 +515,13 @@ int autofs_expire_wait(struct dentry *dentry, int rcu_walk)
 	if (ino->flags & AUTOFS_INF_EXPIRING) {
 		spin_unlock(&sbi->fs_lock);
 
-		DPRINTK("waiting for expire %p name=%.*s",
+		DPRINTK("waiting for expire %p name=%.*s\n",
 			 dentry, dentry->d_name.len, dentry->d_name.name);
 
 		status = autofs_wait(sbi, dentry, NFY_NONE);
 		wait_for_completion(&ino->expire_complete);
 
-		DPRINTK("expire done status=%d", status);
+		DPRINTK("expire done status=%d\n", status);
 
 		if (d_unhashed(dentry))
 			return -EAGAIN;
diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c
index 5012f21..976fd5b 100644
--- a/fs/autofs/inode.c
+++ b/fs/autofs/inode.c
@@ -61,7 +61,7 @@ void autofs_kill_sb(struct super_block *sb)
 		put_pid(sbi->oz_pgrp);
 	}
 
-	DPRINTK("shutting down");
+	DPRINTK("shutting down\n");
 	kill_litter_super(sb);
 	if (sbi)
 		kfree_rcu(sbi, rcu);
@@ -217,7 +217,7 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
 	sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
 	if (!sbi)
 		return -ENOMEM;
-	DPRINTK("starting up, sbi = %p", sbi);
+	DPRINTK("starting up, sbi = %p\n", sbi);
 
 	s->s_fs_info = sbi;
 	sbi->magic = AUTOFS_SBI_MAGIC;
@@ -266,14 +266,14 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
 	if (parse_options(data, &pipefd, &root_inode->i_uid, &root_inode->i_gid,
 			  &pgrp, &pgrp_set, &sbi->type, &sbi->min_proto,
 			  &sbi->max_proto)) {
-		AUTOFS_ERROR("called with bogus options");
+		AUTOFS_ERROR("called with bogus options\n");
 		goto fail_dput;
 	}
 
 	if (pgrp_set) {
 		sbi->oz_pgrp = find_get_pid(pgrp);
 		if (!sbi->oz_pgrp) {
-			AUTOFS_ERROR("could not find process group %d",
+			AUTOFS_ERROR("could not find process group %d\n",
 				pgrp);
 			goto fail_dput;
 		}
@@ -291,7 +291,7 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
 	if (sbi->max_proto < AUTOFS_MIN_PROTO_VERSION ||
 	    sbi->min_proto > AUTOFS_MAX_PROTO_VERSION) {
 		AUTOFS_ERROR("kernel does not match daemon version "
-			     "daemon (%d, %d) kernel (%d, %d)",
+			     "daemon (%d, %d) kernel (%d, %d)\n",
 			sbi->min_proto, sbi->max_proto,
 			AUTOFS_MIN_PROTO_VERSION, AUTOFS_MAX_PROTO_VERSION);
 		goto fail_dput;
@@ -304,11 +304,11 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
 		sbi->version = sbi->max_proto;
 	sbi->sub_version = AUTOFS_PROTO_SUBVERSION;
 
-	DPRINTK("pipe fd = %d, pgrp = %u", pipefd, pid_nr(sbi->oz_pgrp));
+	DPRINTK("pipe fd = %d, pgrp = %u\n", pipefd, pid_nr(sbi->oz_pgrp));
 	pipe = fget(pipefd);
 
 	if (!pipe) {
-		AUTOFS_ERROR("could not open pipe file descriptor");
+		AUTOFS_ERROR("could not open pipe file descriptor\n");
 		goto fail_dput;
 	}
 	ret = autofs_prepare_pipe(pipe);
@@ -329,7 +329,7 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
 	 */
 fail_fput:
 	AUTOFS_ERROR(
-		"pipe file descriptor does not contain proper ops");
+		"pipe file descriptor does not contain proper ops\n");
 	fput(pipe);
 	/* fall through */
 fail_dput:
diff --git a/fs/autofs/root.c b/fs/autofs/root.c
index 8204ef3..0dd77eb 100644
--- a/fs/autofs/root.c
+++ b/fs/autofs/root.c
@@ -109,7 +109,7 @@ static int autofs_dir_open(struct inode *inode, struct file *file)
 	struct dentry *dentry = file->f_path.dentry;
 	struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb);
 
-	DPRINTK("file=%p dentry=%p %.*s",
+	DPRINTK("file=%p dentry=%p %.*s\n",
 		file, dentry, dentry->d_name.len, dentry->d_name.name);
 
 	if (autofs_oz_mode(sbi))
@@ -140,7 +140,7 @@ static void autofs_dentry_release(struct dentry *de)
 	struct autofs_info *ino = autofs_dentry_ino(de);
 	struct autofs_sb_info *sbi = autofs_sbi(de->d_sb);
 
-	DPRINTK("releasing %p", de);
+	DPRINTK("releasing %p\n", de);
 
 	if (!ino)
 		return;
@@ -280,10 +280,10 @@ static int autofs_mount_wait(struct dentry *dentry, bool rcu_walk)
 	if (ino->flags & AUTOFS_INF_PENDING) {
 		if (rcu_walk)
 			return -ECHILD;
-		DPRINTK("waiting for mount name=%.*s",
+		DPRINTK("waiting for mount name=%.*s\n",
 			dentry->d_name.len, dentry->d_name.name);
 		status = autofs_wait(sbi, dentry, NFY_MOUNT);
-		DPRINTK("mount wait done status=%d", status);
+		DPRINTK("mount wait done status=%d\n", status);
 	}
 	ino->last_used = jiffies;
 	return status;
@@ -343,7 +343,7 @@ static struct vfsmount *autofs_d_automount(struct path *path)
 	struct autofs_info *ino = autofs_dentry_ino(dentry);
 	int status;
 
-	DPRINTK("dentry=%p %.*s",
+	DPRINTK("dentry=%p %.*s\n",
 		dentry, dentry->d_name.len, dentry->d_name.name);
 
 	/* The daemon never triggers a mount. */
@@ -431,7 +431,7 @@ static int autofs_d_manage(struct dentry *dentry, bool rcu_walk)
 	struct autofs_info *ino = autofs_dentry_ino(dentry);
 	int status;
 
-	DPRINTK("dentry=%p %.*s",
+	DPRINTK("dentry=%p %.*s\n",
 		dentry, dentry->d_name.len, dentry->d_name.name);
 
 	/* The daemon never waits. */
@@ -509,7 +509,7 @@ static struct dentry *autofs_lookup(struct inode *dir,
 	struct autofs_info *ino;
 	struct dentry *active;
 
-	DPRINTK("name = %.*s", dentry->d_name.len, dentry->d_name.name);
+	DPRINTK("name = %.*s\n", dentry->d_name.len, dentry->d_name.name);
 
 	/* File name too long to exist */
 	if (dentry->d_name.len > NAME_MAX)
@@ -517,7 +517,7 @@ static struct dentry *autofs_lookup(struct inode *dir,
 
 	sbi = autofs_sbi(dir->i_sb);
 
-	DPRINTK("pid = %u, pgrp = %u, catatonic = %d, oz_mode = %d",
+	DPRINTK("pid = %u, pgrp = %u, catatonic = %d, oz_mode = %d\n",
 		current->pid, task_pgrp_nr(current), sbi->catatonic,
 		autofs_oz_mode(sbi));
 
@@ -564,7 +564,7 @@ static int autofs_dir_symlink(struct inode *dir,
 	size_t size = strlen(symname);
 	char *cp;
 
-	DPRINTK("%s <- %.*s", symname,
+	DPRINTK("%s <- %.*s\n", symname,
 		dentry->d_name.len, dentry->d_name.name);
 
 	if (!autofs_oz_mode(sbi))
@@ -705,7 +705,7 @@ static int autofs_dir_rmdir(struct inode *dir, struct dentry *dentry)
 	struct autofs_info *ino = autofs_dentry_ino(dentry);
 	struct autofs_info *p_ino;
 
-	DPRINTK("dentry %p, removing %.*s",
+	DPRINTK("dentry %p, removing %.*s\n",
 		dentry, dentry->d_name.len, dentry->d_name.name);
 
 	if (!autofs_oz_mode(sbi))
@@ -749,7 +749,7 @@ static int autofs_dir_mkdir(struct inode *dir,
 	if (!autofs_oz_mode(sbi))
 		return -EACCES;
 
-	DPRINTK("dentry %p, creating %.*s",
+	DPRINTK("dentry %p, creating %.*s\n",
 		dentry, dentry->d_name.len, dentry->d_name.name);
 
 	BUG_ON(!ino);
@@ -840,7 +840,7 @@ static inline int autofs_ask_umount(struct vfsmount *mnt, int __user *p)
 	if (may_umount(mnt))
 		status = 1;
 
-	DPRINTK("returning %d", status);
+	DPRINTK("returning %d\n", status);
 
 	status = put_user(status, p);
 
@@ -868,7 +868,7 @@ static int autofs_root_ioctl_unlocked(struct inode *inode, struct file *filp,
 	struct autofs_sb_info *sbi = autofs_sbi(inode->i_sb);
 	void __user *p = (void __user *)arg;
 
-	DPRINTK("cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u",
+	DPRINTK("cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u\n",
 		cmd, arg, sbi, task_pgrp_nr(current));
 
 	if (_IOC_TYPE(cmd) != _IOC_TYPE(AUTOFS_IOC_FIRST) ||
diff --git a/fs/autofs/waitq.c b/fs/autofs/waitq.c
index 0fb2791..26d5e5e 100644
--- a/fs/autofs/waitq.c
+++ b/fs/autofs/waitq.c
@@ -31,7 +31,7 @@ void autofs_catatonic_mode(struct autofs_sb_info *sbi)
 		return;
 	}
 
-	DPRINTK("entering catatonic mode");
+	DPRINTK("entering catatonic mode\n");
 
 	sbi->catatonic = 1;
 	wq = sbi->queues;
@@ -99,7 +99,7 @@ static void autofs_notify_daemon(struct autofs_sb_info *sbi,
 	struct file *pipe = NULL;
 	size_t pktsz;
 
-	DPRINTK("wait id = 0x%08lx, name = %.*s, type=%d",
+	DPRINTK("wait id = 0x%08lx, name = %.*s, type=%d\n",
 		(unsigned long) wq->wait_queue_token,
 		wq->name.len, wq->name.name, type);
 
@@ -162,7 +162,7 @@ static void autofs_notify_daemon(struct autofs_sb_info *sbi,
 		break;
 	}
 	default:
-		AUTOFS_WARN("bad type %d!", type);
+		AUTOFS_WARN("bad type %d!\n", type);
 		mutex_unlock(&sbi->wq_mutex);
 		return;
 	}
@@ -460,7 +460,7 @@ int autofs_wait(struct autofs_sb_info *sbi,
 		autofs_notify_daemon(sbi, wq, type);
 	} else {
 		wq->wait_ctr++;
-		DPRINTK("existing wait id = 0x%08lx, name = %.*s, nfy=%d",
+		DPRINTK("existing wait id = 0x%08lx, name = %.*s, nfy=%d\n",
 			(unsigned long) wq->wait_queue_token, wq->name.len,
 			wq->name.name, notify);
 		mutex_unlock(&sbi->wq_mutex);
@@ -489,7 +489,7 @@ int autofs_wait(struct autofs_sb_info *sbi,
 		recalc_sigpending();
 		spin_unlock_irqrestore(&current->sighand->siglock, irqflags);
 	} else {
-		DPRINTK("skipped sleeping");
+		DPRINTK("skipped sleeping\n");
 	}
 
 	status = wq->status;


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/3] autofs - use pr_xxx() calls directly for logging
  2014-11-11  1:29 [PATCH 1/3] autofs - fix log print messages Ian Kent
  2014-11-11  1:30 ` [PATCH 2/3] autofs - change log prints to not insert newline Ian Kent
@ 2014-11-11  1:30 ` Ian Kent
  2014-11-11  3:25 ` [PATCH 1/3] autofs - fix log print messages Joe Perches
  2 siblings, 0 replies; 11+ messages in thread
From: Ian Kent @ 2014-11-11  1:30 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Joe Perches, linux-fsdevel, autofs mailing list, Kernel Mailing List

From: Ian Kent <ikent@redhat.com>


---
 fs/autofs/autofs_i.h  |   15 ++++-----------
 fs/autofs/dev-ioctl.c |   26 +++++++++++++-------------
 fs/autofs/expire.c    |   42 +++++++++++++++++++++---------------------
 fs/autofs/inode.c     |   17 ++++++++---------
 fs/autofs/root.c      |   44 ++++++++++++++++++++++----------------------
 fs/autofs/waitq.c     |   24 ++++++++++++------------
 6 files changed, 80 insertions(+), 88 deletions(-)

diff --git a/fs/autofs/autofs_i.h b/fs/autofs/autofs_i.h
index 84d5060..1015999 100644
--- a/fs/autofs/autofs_i.h
+++ b/fs/autofs/autofs_i.h
@@ -36,17 +36,10 @@
 
 /* #define DEBUG */
 
-#define DPRINTK(fmt, ...)				\
-	pr_debug(KBUILD_MODNAME ":pid:%d:%s: " fmt,	\
-		current->pid, __func__, ##__VA_ARGS__)
-
-#define AUTOFS_WARN(fmt, ...)				\
-	pr_warn(KBUILD_MODNAME ":pid:%d:%s: " fmt,	\
-		current->pid, __func__, ##__VA_ARGS__)
-
-#define AUTOFS_ERROR(fmt, ...)				\
-	pr_err(KBUILD_MODNAME ":pid:%d:%s: " fmt,	\
-		current->pid, __func__, ##__VA_ARGS__)
+#ifdef pr_fmt
+#undef pr_fmt
+#endif
+#define pr_fmt(fmt) KBUILD_MODNAME ":pid:%d:%s: " fmt, current->pid, __func__
 
 /*
  * Unified info structure.  This is pointed to by both the dentry and
diff --git a/fs/autofs/dev-ioctl.c b/fs/autofs/dev-ioctl.c
index 15ce91b..db04512 100644
--- a/fs/autofs/dev-ioctl.c
+++ b/fs/autofs/dev-ioctl.c
@@ -74,11 +74,11 @@ static int check_dev_ioctl_version(int cmd, struct autofs_dev_ioctl *param)
 
 	if ((AUTOFS_DEV_IOCTL_VERSION_MAJOR != param->ver_major) ||
 	    (AUTOFS_DEV_IOCTL_VERSION_MINOR < param->ver_minor)) {
-		AUTOFS_WARN("ioctl control interface version mismatch: "
-		     "kernel(%u.%u), user(%u.%u), cmd(%d)\n",
-		     AUTOFS_DEV_IOCTL_VERSION_MAJOR,
-		     AUTOFS_DEV_IOCTL_VERSION_MINOR,
-		     param->ver_major, param->ver_minor, cmd);
+		pr_warn("ioctl control interface version mismatch: "
+			"kernel(%u.%u), user(%u.%u), cmd(%d)\n",
+			AUTOFS_DEV_IOCTL_VERSION_MAJOR,
+			AUTOFS_DEV_IOCTL_VERSION_MINOR,
+			param->ver_major, param->ver_minor, cmd);
 		err = -EINVAL;
 	}
 
@@ -125,15 +125,15 @@ static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param)
 
 	err = check_dev_ioctl_version(cmd, param);
 	if (err) {
-		AUTOFS_WARN("invalid device control module version "
-		     "supplied for cmd(0x%08x)\n", cmd);
+		pr_warn("invalid device control module version "
+			"supplied for cmd(0x%08x)\n", cmd);
 		goto out;
 	}
 
 	if (param->size > sizeof(*param)) {
 		err = invalid_str(param->path, param->size - sizeof(*param));
 		if (err) {
-			AUTOFS_WARN(
+			pr_warn(
 			  "path string terminator missing for cmd(0x%08x)\n",
 			  cmd);
 			goto out;
@@ -141,8 +141,8 @@ static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param)
 
 		err = check_name(param->path);
 		if (err) {
-			AUTOFS_WARN("invalid path supplied for cmd(0x%08x)\n",
-				    cmd);
+			pr_warn("invalid path supplied for cmd(0x%08x)\n",
+				cmd);
 			goto out;
 		}
 	}
@@ -369,7 +369,7 @@ static int autofs_dev_ioctl_setpipefd(struct file *fp,
 		new_pid = get_task_pid(current, PIDTYPE_PGID);
 
 		if (ns_of_pid(new_pid) != ns_of_pid(sbi->oz_pgrp)) {
-			AUTOFS_WARN("not allowed to change PID namespace\n");
+			pr_warn("not allowed to change PID namespace\n");
 			err = -EINVAL;
 			goto out;
 		}
@@ -657,7 +657,7 @@ static int _autofs_dev_ioctl(unsigned int command,
 
 	fn = lookup_dev_ioctl(cmd);
 	if (!fn) {
-		AUTOFS_WARN("unknown command 0x%08x\n", command);
+		pr_warn("unknown command 0x%08x\n", command);
 		return -ENOTTY;
 	}
 
@@ -750,7 +750,7 @@ int __init autofs_dev_ioctl_init(void)
 
 	r = misc_register(&_autofs_dev_ioctl_misc);
 	if (r) {
-		AUTOFS_ERROR("misc_register failed for control device\n");
+		pr_err("misc_register failed for control device\n");
 		return r;
 	}
 
diff --git a/fs/autofs/expire.c b/fs/autofs/expire.c
index 99f51cf..d2118c6 100644
--- a/fs/autofs/expire.c
+++ b/fs/autofs/expire.c
@@ -38,8 +38,8 @@ static int autofs_mount_busy(struct vfsmount *mnt, struct dentry *dentry)
 	struct path path = {.mnt = mnt, .dentry = dentry};
 	int status = 1;
 
-	DPRINTK("dentry %p %.*s\n",
-		dentry, (int)dentry->d_name.len, dentry->d_name.name);
+	pr_debug("dentry %p %.*s\n",
+		 dentry, (int)dentry->d_name.len, dentry->d_name.name);
 
 	path_get(&path);
 
@@ -65,7 +65,7 @@ static int autofs_mount_busy(struct vfsmount *mnt, struct dentry *dentry)
 
 	status = 0;
 done:
-	DPRINTK("returning = %d\n", status);
+	pr_debug("returning = %d\n", status);
 	path_put(&path);
 	return status;
 }
@@ -191,8 +191,8 @@ static int autofs_direct_busy(struct vfsmount *mnt,
 			      unsigned long timeout,
 			      int do_now)
 {
-	DPRINTK("top %p %.*s\n",
-		top, (int) top->d_name.len, top->d_name.name);
+	pr_debug("top %p %.*s\n",
+		 top, (int) top->d_name.len, top->d_name.name);
 
 	/* If it's busy update the expiry counters */
 	if (!may_umount_tree(mnt)) {
@@ -223,8 +223,8 @@ static int autofs_tree_busy(struct vfsmount *mnt,
 	struct autofs_info *top_ino = autofs_dentry_ino(top);
 	struct dentry *p;
 
-	DPRINTK("top %p %.*s\n",
-		top, (int)top->d_name.len, top->d_name.name);
+	pr_debug("top %p %.*s\n",
+		 top, (int)top->d_name.len, top->d_name.name);
 
 	/* Negative dentry - give up */
 	if (!simple_positive(top))
@@ -232,8 +232,8 @@ static int autofs_tree_busy(struct vfsmount *mnt,
 
 	p = NULL;
 	while ((p = get_next_positive_dentry(p, top))) {
-		DPRINTK("dentry %p %.*s\n",
-			p, (int) p->d_name.len, p->d_name.name);
+		pr_debug("dentry %p %.*s\n",
+			 p, (int) p->d_name.len, p->d_name.name);
 
 		/*
 		 * Is someone visiting anywhere in the subtree ?
@@ -279,13 +279,13 @@ static struct dentry *autofs_check_leaves(struct vfsmount *mnt,
 {
 	struct dentry *p;
 
-	DPRINTK("parent %p %.*s\n",
-		parent, (int)parent->d_name.len, parent->d_name.name);
+	pr_debug("parent %p %.*s\n",
+		 parent, (int)parent->d_name.len, parent->d_name.name);
 
 	p = NULL;
 	while ((p = get_next_positive_dentry(p, parent))) {
-		DPRINTK("dentry %p %.*s\n",
-			p, (int) p->d_name.len, p->d_name.name);
+		pr_debug("dentry %p %.*s\n",
+			 p, (int) p->d_name.len, p->d_name.name);
 
 		if (d_mountpoint(p)) {
 			/* Can we umount this guy */
@@ -370,8 +370,8 @@ static struct dentry *should_expire(struct dentry *dentry,
 	 *	   offset (autofs-5.0+).
 	 */
 	if (d_mountpoint(dentry)) {
-		DPRINTK("checking mountpoint %p %.*s\n", dentry,
-			(int) dentry->d_name.len, dentry->d_name.name);
+		pr_debug("checking mountpoint %p %.*s\n", dentry,
+			 (int) dentry->d_name.len, dentry->d_name.name);
 
 		/* Can we umount this guy */
 		if (autofs_mount_busy(mnt, dentry))
@@ -384,8 +384,8 @@ static struct dentry *should_expire(struct dentry *dentry,
 	}
 
 	if (dentry->d_inode && S_ISLNK(dentry->d_inode->i_mode)) {
-		DPRINTK("checking symlink %p %.*s\n",
-			dentry, (int)dentry->d_name.len, dentry->d_name.name);
+		pr_debug("checking symlink %p %.*s\n",
+			 dentry, (int)dentry->d_name.len, dentry->d_name.name);
 		/*
 		 * A symlink can't be "busy" in the usual sense so
 		 * just check last used for expire timeout.
@@ -482,8 +482,8 @@ struct dentry *autofs_expire_indirect(struct super_block *sb,
 	return NULL;
 
 found:
-	DPRINTK("returning %p %.*s\n",
-		expired, (int)expired->d_name.len, expired->d_name.name);
+	pr_debug("returning %p %.*s\n",
+		 expired, (int)expired->d_name.len, expired->d_name.name);
 	ino->flags |= AUTOFS_INF_EXPIRING;
 	smp_mb();
 	ino->flags &= ~AUTOFS_INF_NO_RCU;
@@ -515,13 +515,13 @@ int autofs_expire_wait(struct dentry *dentry, int rcu_walk)
 	if (ino->flags & AUTOFS_INF_EXPIRING) {
 		spin_unlock(&sbi->fs_lock);
 
-		DPRINTK("waiting for expire %p name=%.*s\n",
+		pr_debug("waiting for expire %p name=%.*s\n",
 			 dentry, dentry->d_name.len, dentry->d_name.name);
 
 		status = autofs_wait(sbi, dentry, NFY_NONE);
 		wait_for_completion(&ino->expire_complete);
 
-		DPRINTK("expire done status=%d\n", status);
+		pr_debug("expire done status=%d\n", status);
 
 		if (d_unhashed(dentry))
 			return -EAGAIN;
diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c
index 976fd5b..761cf12 100644
--- a/fs/autofs/inode.c
+++ b/fs/autofs/inode.c
@@ -61,7 +61,7 @@ void autofs_kill_sb(struct super_block *sb)
 		put_pid(sbi->oz_pgrp);
 	}
 
-	DPRINTK("shutting down\n");
+	pr_debug("shutting down\n");
 	kill_litter_super(sb);
 	if (sbi)
 		kfree_rcu(sbi, rcu);
@@ -217,7 +217,7 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
 	sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
 	if (!sbi)
 		return -ENOMEM;
-	DPRINTK("starting up, sbi = %p\n", sbi);
+	pr_debug("starting up, sbi = %p\n", sbi);
 
 	s->s_fs_info = sbi;
 	sbi->magic = AUTOFS_SBI_MAGIC;
@@ -266,14 +266,14 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
 	if (parse_options(data, &pipefd, &root_inode->i_uid, &root_inode->i_gid,
 			  &pgrp, &pgrp_set, &sbi->type, &sbi->min_proto,
 			  &sbi->max_proto)) {
-		AUTOFS_ERROR("called with bogus options\n");
+		pr_err("called with bogus options\n");
 		goto fail_dput;
 	}
 
 	if (pgrp_set) {
 		sbi->oz_pgrp = find_get_pid(pgrp);
 		if (!sbi->oz_pgrp) {
-			AUTOFS_ERROR("could not find process group %d\n",
+			pr_err("could not find process group %d\n",
 				pgrp);
 			goto fail_dput;
 		}
@@ -290,7 +290,7 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
 	/* Couldn't this be tested earlier? */
 	if (sbi->max_proto < AUTOFS_MIN_PROTO_VERSION ||
 	    sbi->min_proto > AUTOFS_MAX_PROTO_VERSION) {
-		AUTOFS_ERROR("kernel does not match daemon version "
+		pr_err("kernel does not match daemon version "
 			     "daemon (%d, %d) kernel (%d, %d)\n",
 			sbi->min_proto, sbi->max_proto,
 			AUTOFS_MIN_PROTO_VERSION, AUTOFS_MAX_PROTO_VERSION);
@@ -304,11 +304,11 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
 		sbi->version = sbi->max_proto;
 	sbi->sub_version = AUTOFS_PROTO_SUBVERSION;
 
-	DPRINTK("pipe fd = %d, pgrp = %u\n", pipefd, pid_nr(sbi->oz_pgrp));
+	pr_debug("pipe fd = %d, pgrp = %u\n", pipefd, pid_nr(sbi->oz_pgrp));
 	pipe = fget(pipefd);
 
 	if (!pipe) {
-		AUTOFS_ERROR("could not open pipe file descriptor\n");
+		pr_err("could not open pipe file descriptor\n");
 		goto fail_dput;
 	}
 	ret = autofs_prepare_pipe(pipe);
@@ -328,8 +328,7 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
 	 * Failure ... clean up.
 	 */
 fail_fput:
-	AUTOFS_ERROR(
-		"pipe file descriptor does not contain proper ops\n");
+	pr_err("pipe file descriptor does not contain proper ops\n");
 	fput(pipe);
 	/* fall through */
 fail_dput:
diff --git a/fs/autofs/root.c b/fs/autofs/root.c
index 0dd77eb..8b5220e 100644
--- a/fs/autofs/root.c
+++ b/fs/autofs/root.c
@@ -109,8 +109,8 @@ static int autofs_dir_open(struct inode *inode, struct file *file)
 	struct dentry *dentry = file->f_path.dentry;
 	struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb);
 
-	DPRINTK("file=%p dentry=%p %.*s\n",
-		file, dentry, dentry->d_name.len, dentry->d_name.name);
+	pr_debug("file=%p dentry=%p %.*s\n",
+		 file, dentry, dentry->d_name.len, dentry->d_name.name);
 
 	if (autofs_oz_mode(sbi))
 		goto out;
@@ -140,7 +140,7 @@ static void autofs_dentry_release(struct dentry *de)
 	struct autofs_info *ino = autofs_dentry_ino(de);
 	struct autofs_sb_info *sbi = autofs_sbi(de->d_sb);
 
-	DPRINTK("releasing %p\n", de);
+	pr_debug("releasing %p\n", de);
 
 	if (!ino)
 		return;
@@ -280,10 +280,10 @@ static int autofs_mount_wait(struct dentry *dentry, bool rcu_walk)
 	if (ino->flags & AUTOFS_INF_PENDING) {
 		if (rcu_walk)
 			return -ECHILD;
-		DPRINTK("waiting for mount name=%.*s\n",
+		pr_debug("waiting for mount name=%.*s\n",
 			dentry->d_name.len, dentry->d_name.name);
 		status = autofs_wait(sbi, dentry, NFY_MOUNT);
-		DPRINTK("mount wait done status=%d\n", status);
+		pr_debug("mount wait done status=%d\n", status);
 	}
 	ino->last_used = jiffies;
 	return status;
@@ -343,8 +343,8 @@ static struct vfsmount *autofs_d_automount(struct path *path)
 	struct autofs_info *ino = autofs_dentry_ino(dentry);
 	int status;
 
-	DPRINTK("dentry=%p %.*s\n",
-		dentry, dentry->d_name.len, dentry->d_name.name);
+	pr_debug("dentry=%p %.*s\n",
+		 dentry, dentry->d_name.len, dentry->d_name.name);
 
 	/* The daemon never triggers a mount. */
 	if (autofs_oz_mode(sbi))
@@ -431,8 +431,8 @@ static int autofs_d_manage(struct dentry *dentry, bool rcu_walk)
 	struct autofs_info *ino = autofs_dentry_ino(dentry);
 	int status;
 
-	DPRINTK("dentry=%p %.*s\n",
-		dentry, dentry->d_name.len, dentry->d_name.name);
+	pr_debug("dentry=%p %.*s\n",
+		 dentry, dentry->d_name.len, dentry->d_name.name);
 
 	/* The daemon never waits. */
 	if (autofs_oz_mode(sbi)) {
@@ -509,7 +509,7 @@ static struct dentry *autofs_lookup(struct inode *dir,
 	struct autofs_info *ino;
 	struct dentry *active;
 
-	DPRINTK("name = %.*s\n", dentry->d_name.len, dentry->d_name.name);
+	pr_debug("name = %.*s\n", dentry->d_name.len, dentry->d_name.name);
 
 	/* File name too long to exist */
 	if (dentry->d_name.len > NAME_MAX)
@@ -517,9 +517,9 @@ static struct dentry *autofs_lookup(struct inode *dir,
 
 	sbi = autofs_sbi(dir->i_sb);
 
-	DPRINTK("pid = %u, pgrp = %u, catatonic = %d, oz_mode = %d\n",
-		current->pid, task_pgrp_nr(current), sbi->catatonic,
-		autofs_oz_mode(sbi));
+	pr_debug("pid = %u, pgrp = %u, catatonic = %d, oz_mode = %d\n",
+		 current->pid, task_pgrp_nr(current), sbi->catatonic,
+		 autofs_oz_mode(sbi));
 
 	active = autofs_lookup_active(dentry);
 	if (active)
@@ -564,8 +564,8 @@ static int autofs_dir_symlink(struct inode *dir,
 	size_t size = strlen(symname);
 	char *cp;
 
-	DPRINTK("%s <- %.*s\n", symname,
-		dentry->d_name.len, dentry->d_name.name);
+	pr_debug("%s <- %.*s\n", symname,
+		 dentry->d_name.len, dentry->d_name.name);
 
 	if (!autofs_oz_mode(sbi))
 		return -EACCES;
@@ -705,8 +705,8 @@ static int autofs_dir_rmdir(struct inode *dir, struct dentry *dentry)
 	struct autofs_info *ino = autofs_dentry_ino(dentry);
 	struct autofs_info *p_ino;
 
-	DPRINTK("dentry %p, removing %.*s\n",
-		dentry, dentry->d_name.len, dentry->d_name.name);
+	pr_debug("dentry %p, removing %.*s\n",
+		 dentry, dentry->d_name.len, dentry->d_name.name);
 
 	if (!autofs_oz_mode(sbi))
 		return -EACCES;
@@ -749,8 +749,8 @@ static int autofs_dir_mkdir(struct inode *dir,
 	if (!autofs_oz_mode(sbi))
 		return -EACCES;
 
-	DPRINTK("dentry %p, creating %.*s\n",
-		dentry, dentry->d_name.len, dentry->d_name.name);
+	pr_debug("dentry %p, creating %.*s\n",
+		 dentry, dentry->d_name.len, dentry->d_name.name);
 
 	BUG_ON(!ino);
 
@@ -840,7 +840,7 @@ static inline int autofs_ask_umount(struct vfsmount *mnt, int __user *p)
 	if (may_umount(mnt))
 		status = 1;
 
-	DPRINTK("returning %d\n", status);
+	pr_debug("returning %d\n", status);
 
 	status = put_user(status, p);
 
@@ -868,8 +868,8 @@ static int autofs_root_ioctl_unlocked(struct inode *inode, struct file *filp,
 	struct autofs_sb_info *sbi = autofs_sbi(inode->i_sb);
 	void __user *p = (void __user *)arg;
 
-	DPRINTK("cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u\n",
-		cmd, arg, sbi, task_pgrp_nr(current));
+	pr_debug("cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u\n",
+		 cmd, arg, sbi, task_pgrp_nr(current));
 
 	if (_IOC_TYPE(cmd) != _IOC_TYPE(AUTOFS_IOC_FIRST) ||
 	     _IOC_NR(cmd) - _IOC_NR(AUTOFS_IOC_FIRST) >= AUTOFS_IOC_COUNT)
diff --git a/fs/autofs/waitq.c b/fs/autofs/waitq.c
index 26d5e5e..c94d287 100644
--- a/fs/autofs/waitq.c
+++ b/fs/autofs/waitq.c
@@ -31,7 +31,7 @@ void autofs_catatonic_mode(struct autofs_sb_info *sbi)
 		return;
 	}
 
-	DPRINTK("entering catatonic mode\n");
+	pr_debug("entering catatonic mode\n");
 
 	sbi->catatonic = 1;
 	wq = sbi->queues;
@@ -99,9 +99,9 @@ static void autofs_notify_daemon(struct autofs_sb_info *sbi,
 	struct file *pipe = NULL;
 	size_t pktsz;
 
-	DPRINTK("wait id = 0x%08lx, name = %.*s, type=%d\n",
-		(unsigned long) wq->wait_queue_token,
-		wq->name.len, wq->name.name, type);
+	pr_debug("wait id = 0x%08lx, name = %.*s, type=%d\n",
+		 (unsigned long) wq->wait_queue_token,
+		 wq->name.len, wq->name.name, type);
 
 	memset(&pkt, 0, sizeof(pkt)); /* For security reasons */
 
@@ -162,7 +162,7 @@ static void autofs_notify_daemon(struct autofs_sb_info *sbi,
 		break;
 	}
 	default:
-		AUTOFS_WARN("bad type %d!\n", type);
+		pr_warn("bad type %d!\n", type);
 		mutex_unlock(&sbi->wq_mutex);
 		return;
 	}
@@ -450,9 +450,9 @@ int autofs_wait(struct autofs_sb_info *sbi,
 					autofs_ptype_expire_indirect;
 		}
 
-		DPRINTK("new wait id = 0x%08lx, name = %.*s, nfy=%d",
-			(unsigned long) wq->wait_queue_token, wq->name.len,
-			wq->name.name, notify);
+		pr_debug("new wait id = 0x%08lx, name = %.*s, nfy=%d",
+			 (unsigned long) wq->wait_queue_token, wq->name.len,
+			 wq->name.name, notify);
 
 		/*
 		 * autofs_notify_daemon() may block; it will unlock ->wq_mutex
@@ -460,9 +460,9 @@ int autofs_wait(struct autofs_sb_info *sbi,
 		autofs_notify_daemon(sbi, wq, type);
 	} else {
 		wq->wait_ctr++;
-		DPRINTK("existing wait id = 0x%08lx, name = %.*s, nfy=%d\n",
-			(unsigned long) wq->wait_queue_token, wq->name.len,
-			wq->name.name, notify);
+		pr_debug("existing wait id = 0x%08lx, name = %.*s, nfy=%d\n",
+			 (unsigned long) wq->wait_queue_token, wq->name.len,
+			 wq->name.name, notify);
 		mutex_unlock(&sbi->wq_mutex);
 		kfree(qstr.name);
 	}
@@ -489,7 +489,7 @@ int autofs_wait(struct autofs_sb_info *sbi,
 		recalc_sigpending();
 		spin_unlock_irqrestore(&current->sighand->siglock, irqflags);
 	} else {
-		DPRINTK("skipped sleeping\n");
+		pr_debug("skipped sleeping\n");
 	}
 
 	status = wq->status;


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] autofs - fix log print messages
  2014-11-11  1:29 [PATCH 1/3] autofs - fix log print messages Ian Kent
  2014-11-11  1:30 ` [PATCH 2/3] autofs - change log prints to not insert newline Ian Kent
  2014-11-11  1:30 ` [PATCH 3/3] autofs - use pr_xxx() calls directly for logging Ian Kent
@ 2014-11-11  3:25 ` Joe Perches
  2014-11-11  5:37   ` Ian Kent
  2 siblings, 1 reply; 11+ messages in thread
From: Joe Perches @ 2014-11-11  3:25 UTC (permalink / raw)
  To: Ian Kent
  Cc: Andrew Morton, linux-fsdevel, autofs mailing list, Kernel Mailing List

On Tue, 2014-11-11 at 09:29 +0800, Ian Kent wrote:
> Fix some inconsistencies in log print output and ensure that
> the module name is included in all log prints.
> 
> Signed-off-by: Ian Kent <raven@themaw.net>
> Cc: Joe Perches <joe@perches.com>
> ---
>  fs/autofs/autofs_i.h  |    6 +++---
>  fs/autofs/dev-ioctl.c |    2 +-
>  fs/autofs/inode.c     |   10 +++++-----
>  fs/autofs/waitq.c     |    4 ++--
>  4 files changed, 11 insertions(+), 11 deletions(-)

What tree are these patches made against?



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] autofs - fix log print messages
  2014-11-11  3:25 ` [PATCH 1/3] autofs - fix log print messages Joe Perches
@ 2014-11-11  5:37   ` Ian Kent
  2014-11-11  5:49     ` Joe Perches
  0 siblings, 1 reply; 11+ messages in thread
From: Ian Kent @ 2014-11-11  5:37 UTC (permalink / raw)
  To: Joe Perches
  Cc: Andrew Morton, linux-fsdevel, autofs mailing list, Kernel Mailing List

On Mon, 2014-11-10 at 19:25 -0800, Joe Perches wrote:
> On Tue, 2014-11-11 at 09:29 +0800, Ian Kent wrote:
> > Fix some inconsistencies in log print output and ensure that
> > the module name is included in all log prints.
> > 
> > Signed-off-by: Ian Kent <raven@themaw.net>
> > Cc: Joe Perches <joe@perches.com>
> > ---
> >  fs/autofs/autofs_i.h  |    6 +++---
> >  fs/autofs/dev-ioctl.c |    2 +-
> >  fs/autofs/inode.c     |   10 +++++-----
> >  fs/autofs/waitq.c     |    4 ++--
> >  4 files changed, 11 insertions(+), 11 deletions(-)
> 
> What tree are these patches made against?

They live in an StGit patch queue against the current Linus tree.
They depend on the prior series to rename autofs4 to autofs.

Ian


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] autofs - fix log print messages
  2014-11-11  5:37   ` Ian Kent
@ 2014-11-11  5:49     ` Joe Perches
  2014-11-11  6:01       ` Ian Kent
  2014-11-11  6:07       ` Ian Kent
  0 siblings, 2 replies; 11+ messages in thread
From: Joe Perches @ 2014-11-11  5:49 UTC (permalink / raw)
  To: Ian Kent
  Cc: Andrew Morton, linux-fsdevel, autofs mailing list, Kernel Mailing List

On Tue, 2014-11-11 at 13:37 +0800, Ian Kent wrote:
> On Mon, 2014-11-10 at 19:25 -0800, Joe Perches wrote:
> > On Tue, 2014-11-11 at 09:29 +0800, Ian Kent wrote:
> > > Fix some inconsistencies in log print output and ensure that
> > > the module name is included in all log prints.
> > > 
> > > Signed-off-by: Ian Kent <raven@themaw.net>
> > > Cc: Joe Perches <joe@perches.com>
> > > ---
> > >  fs/autofs/autofs_i.h  |    6 +++---
> > >  fs/autofs/dev-ioctl.c |    2 +-
> > >  fs/autofs/inode.c     |   10 +++++-----
> > >  fs/autofs/waitq.c     |    4 ++--
> > >  4 files changed, 11 insertions(+), 11 deletions(-)
> > 
> > What tree are these patches made against?
> 
> They live in an StGit patch queue against the current Linus tree.
> They depend on the prior series to rename autofs4 to autofs.

Hey Ian.

Maybe you could add the git tree location to
the MAINTAINERS entry:

MAINTAINERS-KERNEL AUTOMOUNTER v4 (AUTOFS4)
MAINTAINERS-M:  Ian Kent <raven@themaw.net>
MAINTAINERS-L:  autofs@vger.kernel.org
MAINTAINERS-S:  Maintained
MAINTAINERS:F:  fs/autofs4/

T:	git git://somewhere_or_other...

and maybe you also could get Stephen Rothwell
to add that tree to -next



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] autofs - fix log print messages
  2014-11-11  5:49     ` Joe Perches
@ 2014-11-11  6:01       ` Ian Kent
  2014-11-12 23:07         ` Andrew Morton
  2014-11-11  6:07       ` Ian Kent
  1 sibling, 1 reply; 11+ messages in thread
From: Ian Kent @ 2014-11-11  6:01 UTC (permalink / raw)
  To: Joe Perches
  Cc: Andrew Morton, linux-fsdevel, autofs mailing list, Kernel Mailing List

On Mon, 2014-11-10 at 21:49 -0800, Joe Perches wrote:
> On Tue, 2014-11-11 at 13:37 +0800, Ian Kent wrote:
> > On Mon, 2014-11-10 at 19:25 -0800, Joe Perches wrote:
> > > On Tue, 2014-11-11 at 09:29 +0800, Ian Kent wrote:
> > > > Fix some inconsistencies in log print output and ensure that
> > > > the module name is included in all log prints.
> > > > 
> > > > Signed-off-by: Ian Kent <raven@themaw.net>
> > > > Cc: Joe Perches <joe@perches.com>
> > > > ---
> > > >  fs/autofs/autofs_i.h  |    6 +++---
> > > >  fs/autofs/dev-ioctl.c |    2 +-
> > > >  fs/autofs/inode.c     |   10 +++++-----
> > > >  fs/autofs/waitq.c     |    4 ++--
> > > >  4 files changed, 11 insertions(+), 11 deletions(-)
> > > 
> > > What tree are these patches made against?
> > 
> > They live in an StGit patch queue against the current Linus tree.
> > They depend on the prior series to rename autofs4 to autofs.
> 
> Hey Ian.
> 
> Maybe you could add the git tree location to
> the MAINTAINERS entry:
> 
> MAINTAINERS-KERNEL AUTOMOUNTER v4 (AUTOFS4)
> MAINTAINERS-M:  Ian Kent <raven@themaw.net>
> MAINTAINERS-L:  autofs@vger.kernel.org
> MAINTAINERS-S:  Maintained
> MAINTAINERS:F:  fs/autofs4/
> 
> T:	git git://somewhere_or_other...
> 
> and maybe you also could get Stephen Rothwell
> to add that tree to -next

Oh, you meant what public tree.

I guess I could make a kernel.org tree but, apart from this recent
rename autofs4 -> autofs, the number of autofs changes hasn't warranted
maintaining a separate tree for quite a while.

It looks like the place holder under /pub/scm/linux/kernel/git/raven is
no longer present so I expect I'd need to request that be setup.

That's why I just send my patches to Andrew to include them in -next.

Andrew, thoughts?
Ian


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] autofs - fix log print messages
  2014-11-11  5:49     ` Joe Perches
  2014-11-11  6:01       ` Ian Kent
@ 2014-11-11  6:07       ` Ian Kent
  1 sibling, 0 replies; 11+ messages in thread
From: Ian Kent @ 2014-11-11  6:07 UTC (permalink / raw)
  To: Joe Perches
  Cc: Andrew Morton, linux-fsdevel, autofs mailing list, Kernel Mailing List

On Mon, 2014-11-10 at 21:49 -0800, Joe Perches wrote:
> On Tue, 2014-11-11 at 13:37 +0800, Ian Kent wrote:
> > On Mon, 2014-11-10 at 19:25 -0800, Joe Perches wrote:
> > > On Tue, 2014-11-11 at 09:29 +0800, Ian Kent wrote:
> > > > Fix some inconsistencies in log print output and ensure that
> > > > the module name is included in all log prints.
> > > > 
> > > > Signed-off-by: Ian Kent <raven@themaw.net>
> > > > Cc: Joe Perches <joe@perches.com>
> > > > ---
> > > >  fs/autofs/autofs_i.h  |    6 +++---
> > > >  fs/autofs/dev-ioctl.c |    2 +-
> > > >  fs/autofs/inode.c     |   10 +++++-----
> > > >  fs/autofs/waitq.c     |    4 ++--
> > > >  4 files changed, 11 insertions(+), 11 deletions(-)
> > > 
> > > What tree are these patches made against?
> > 
> > They live in an StGit patch queue against the current Linus tree.
> > They depend on the prior series to rename autofs4 to autofs.
> 
> Hey Ian.
> 
> Maybe you could add the git tree location to
> the MAINTAINERS entry:
> 
> MAINTAINERS-KERNEL AUTOMOUNTER v4 (AUTOFS4)
> MAINTAINERS-M:  Ian Kent <raven@themaw.net>
> MAINTAINERS-L:  autofs@vger.kernel.org
> MAINTAINERS-S:  Maintained
> MAINTAINERS:F:  fs/autofs4/

... and I forgot about updating that fs/autofs4/ in MAINTAINERS too, ha,
that'll need another patch.

Ian


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] autofs - fix log print messages
  2014-11-11  6:01       ` Ian Kent
@ 2014-11-12 23:07         ` Andrew Morton
  2014-11-13  0:10           ` Ian Kent
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Morton @ 2014-11-12 23:07 UTC (permalink / raw)
  To: Ian Kent
  Cc: Joe Perches, linux-fsdevel, autofs mailing list, Kernel Mailing List

On Tue, 11 Nov 2014 14:01:52 +0800 Ian Kent <raven@themaw.net> wrote:

> I guess I could make a kernel.org tree but, apart from this recent
> rename autofs4 -> autofs, the number of autofs changes hasn't warranted
> maintaining a separate tree for quite a while.
> 
> It looks like the place holder under /pub/scm/linux/kernel/git/raven is
> no longer present so I expect I'd need to request that be setup.
> 
> That's why I just send my patches to Andrew to include them in -next.
> 
> Andrew, thoughts?

Various options.

a) redo these patches against mainline and I merge them into
   3.19-rc1.  Shortly after that you send me the big rename as plain
   old patches or, preferably, you send Linus a git pull request.  For
   -rc2.

b) You run a git tree for a while.

The tree which these patches were based on seem to have more than a
plain rename.  For example I get

--- fs/autofs4/autofs_i.h
+++ fs/autofs4/autofs_i.h
@@ -37,15 +37,15 @@
 /* #define DEBUG */
 
 #define DPRINTK(fmt, ...)				\
-	pr_debug("pid %d: %s: " fmt "\n",		\
+	pr_debug(KBUILD_MODNAME ":pid:%d:%s: " fmt "\n",\
 		current->pid, __func__, ##__VA_ARGS__)
 
 #define AUTOFS_WARN(fmt, ...)				\
-	pr_warn("pid %d: %s: " fmt "\n",	\
+	pr_warn(KBUILD_MODNAME ":pid:%d:%s: " fmt "\n",	\
 		current->pid, __func__, ##__VA_ARGS__)
 
 #define AUTOFS_ERROR(fmt, ...)				\
-	pr_err("pid %d: %s: " fmt "\n",	\
+	pr_err(KBUILD_MODNAME ":pid:%d:%s: " fmt "\n",	\
 		current->pid, __func__, ##__VA_ARGS__)
 
 /*


But I'm seeing

#define DPRINTK(fmt, ...)				\
	pr_debug("pid %d: %s: " fmt "\n",		\
		current->pid, __func__, ##__VA_ARGS__)

#define AUTOFS_WARN(fmt, ...)				\
	printk(KERN_WARNING "pid %d: %s: " fmt "\n",	\
		current->pid, __func__, ##__VA_ARGS__)

#define AUTOFS_ERROR(fmt, ...)				\
	printk(KERN_ERR "pid %d: %s: " fmt "\n",	\
		current->pid, __func__, ##__VA_ARGS__)

/* Unified info structure.  This is pointed to by both the dentry and

ie: the comment layout was changed.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] autofs - fix log print messages
  2014-11-12 23:07         ` Andrew Morton
@ 2014-11-13  0:10           ` Ian Kent
  2014-11-13  3:50             ` Ian Kent
  0 siblings, 1 reply; 11+ messages in thread
From: Ian Kent @ 2014-11-13  0:10 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Joe Perches, linux-fsdevel, autofs mailing list, Kernel Mailing List

On Wed, 2014-11-12 at 15:07 -0800, Andrew Morton wrote:
> On Tue, 11 Nov 2014 14:01:52 +0800 Ian Kent <raven@themaw.net> wrote:
> 
> > I guess I could make a kernel.org tree but, apart from this recent
> > rename autofs4 -> autofs, the number of autofs changes hasn't warranted
> > maintaining a separate tree for quite a while.
> > 
> > It looks like the place holder under /pub/scm/linux/kernel/git/raven is
> > no longer present so I expect I'd need to request that be setup.
> > 
> > That's why I just send my patches to Andrew to include them in -next.
> > 
> > Andrew, thoughts?
> 
> Various options.
> 
> a) redo these patches against mainline and I merge them into
>    3.19-rc1.  Shortly after that you send me the big rename as plain
>    old patches or, preferably, you send Linus a git pull request.  For
>    -rc2.

Given that something has gone missing along the way I'll fold these
latest patches into my original rename (and cleanup) series and resend
or whatever I end up doing.

> 
> b) You run a git tree for a while.

So that would mean doing what Joe recommended and asking Stephen
Rothwell to accept pull requests for my tree, and then send the pull
request to Linus after some reasonable soak time, correct?

> 
> The tree which these patches were based on seem to have more than a
> plain rename.  For example I get

Right, looks like something has gone missing along the way. 
The tree the patches are against is just a local clone of the Linus tree
with the patches I'd sent previously applied.

Folding these recent patches into the original series and sending one
series only that applies on the current Linus tree should sort out the
problem.

> 
> --- fs/autofs4/autofs_i.h
> +++ fs/autofs4/autofs_i.h
> @@ -37,15 +37,15 @@
>  /* #define DEBUG */
>  
>  #define DPRINTK(fmt, ...)				\
> -	pr_debug("pid %d: %s: " fmt "\n",		\
> +	pr_debug(KBUILD_MODNAME ":pid:%d:%s: " fmt "\n",\
>  		current->pid, __func__, ##__VA_ARGS__)
>  
>  #define AUTOFS_WARN(fmt, ...)				\
> -	pr_warn("pid %d: %s: " fmt "\n",	\
> +	pr_warn(KBUILD_MODNAME ":pid:%d:%s: " fmt "\n",	\
>  		current->pid, __func__, ##__VA_ARGS__)
>  
>  #define AUTOFS_ERROR(fmt, ...)				\
> -	pr_err("pid %d: %s: " fmt "\n",	\
> +	pr_err(KBUILD_MODNAME ":pid:%d:%s: " fmt "\n",	\
>  		current->pid, __func__, ##__VA_ARGS__)
>  
>  /*
> 
> 
> But I'm seeing
> 
> #define DPRINTK(fmt, ...)				\
> 	pr_debug("pid %d: %s: " fmt "\n",		\
> 		current->pid, __func__, ##__VA_ARGS__)
> 
> #define AUTOFS_WARN(fmt, ...)				\
> 	printk(KERN_WARNING "pid %d: %s: " fmt "\n",	\
> 		current->pid, __func__, ##__VA_ARGS__)
> 
> #define AUTOFS_ERROR(fmt, ...)				\
> 	printk(KERN_ERR "pid %d: %s: " fmt "\n",	\
> 		current->pid, __func__, ##__VA_ARGS__)
> 
> /* Unified info structure.  This is pointed to by both the dentry and
> 
> ie: the comment layout was changed.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] autofs - fix log print messages
  2014-11-13  0:10           ` Ian Kent
@ 2014-11-13  3:50             ` Ian Kent
  0 siblings, 0 replies; 11+ messages in thread
From: Ian Kent @ 2014-11-13  3:50 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Joe Perches, linux-fsdevel, autofs mailing list, Kernel Mailing List

On Thu, 2014-11-13 at 08:10 +0800, Ian Kent wrote:
> > 
> > The tree which these patches were based on seem to have more than a
> > plain rename.  For example I get
> 
> Right, looks like something has gone missing along the way. 

Ahh .. I get it now.

> The tree the patches are against is just a local clone of the Linus tree
> with the patches I'd sent previously applied.
> 
> Folding these recent patches into the original series and sending one
> series only that applies on the current Linus tree should sort out the
> problem.
> 
> > 
> > --- fs/autofs4/autofs_i.h
> > +++ fs/autofs4/autofs_i.h

Looks like the patches I sent on 3rd Dec, which is what Joe commented
on, were missed.

It's probably better for me to start over once its decided how I'll be
sending the patches.

Ian



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-11-13  3:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-11  1:29 [PATCH 1/3] autofs - fix log print messages Ian Kent
2014-11-11  1:30 ` [PATCH 2/3] autofs - change log prints to not insert newline Ian Kent
2014-11-11  1:30 ` [PATCH 3/3] autofs - use pr_xxx() calls directly for logging Ian Kent
2014-11-11  3:25 ` [PATCH 1/3] autofs - fix log print messages Joe Perches
2014-11-11  5:37   ` Ian Kent
2014-11-11  5:49     ` Joe Perches
2014-11-11  6:01       ` Ian Kent
2014-11-12 23:07         ` Andrew Morton
2014-11-13  0:10           ` Ian Kent
2014-11-13  3:50             ` Ian Kent
2014-11-11  6:07       ` Ian Kent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).