Skip to contentSkip to conversation

nfsd: Export get_task_comm for nfsd

PATCH Applied Pavel Emelyanov 3 participants 4 messages Sep 23, 2010

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsd: Export get_task_comm for nfsd

The git://linux-nfs.org/~bfields/linux.git nfsd-next branch doesn't compile when nfsd is a module with the following error:

ERROR: "get_task_comm" [fs/nfsd/nfsd.ko] undefined!

The get_task_comm is used in nfsctl_transaction_read's printk.

---

fs/exec.c +1 -0
index 828dd24..1d22c4b 100644
@@ -957,6 +957,7 @@ char *get_task_comm(char *buf, struct task_struct *tsk)
 	task_unlock(tsk);
 	return buf;
 }
+EXPORT_SYMBOL_GPL(get_task_comm);
 
 void set_task_comm(struct task_struct *tsk, char *buf)
 {
#1 lore raw
Quoted 6 lines · Pavel Emelyanov

The git://linux-nfs.org/~bfields/linux.git nfsd-next branch doesn't compile when nfsd is a module with the following error:

ERROR: "get_task_comm" [fs/nfsd/nfsd.ko] undefined!

The get_task_comm is used in nfsctl_transaction_read's printk.

Why doesn't it simply use current->comm as countless other users? Assuming it doesn't actually want to print comm for a non-current users which would rather surprise me.

#2 lore raw
Quoted 1 line

Why doesn't it simply use current->comm as countless other users?

Yep, this is indeed better...

The git://linux-nfs.org/~bfields/linux.git nfsd-next branch doesn't compile when nfsd is a module with the following error:

ERROR: "get_task_comm" [fs/nfsd/nfsd.ko] undefined!

Replace the get_task_comm call with direct comm access, which is safe for current.

---

fs/nfsd/nfsctl.c +1 -3
index 83c82ed..b6e192d 100644
@@ -129,12 +129,10 @@ static ssize_t nfsctl_transaction_read(struct file *file, char __user *buf, size
 {
 	static int warned;
 	if (file->f_dentry->d_name.name[0] == '.' && !warned) {
-		char name[sizeof(current->comm)];
 		printk(KERN_INFO
 		       "Warning: \"%s\" uses deprecated NFSD interface: %s."
 		       "  This will be removed in 2.6.40\n",
-		       get_task_comm(name, current),
-		       file->f_dentry->d_name.name);
+		       current->comm, file->f_dentry->d_name.name);
 		warned = 1;
 	}
 	if (! file->private_data) {
#3 lore raw
Quoted 7 lines · Pavel Emelyanov
Quoted 1 line

Why doesn't it simply use current->comm as countless other users?

Yep, this is indeed better...

The git://linux-nfs.org/~bfields/linux.git nfsd-next branch doesn't compile when nfsd is a module with the following error:

Quoted 6 lines

ERROR: "get_task_comm" [fs/nfsd/nfsd.ko] undefined!

Replace the get_task_comm call with direct comm access, which is safe for current.

Applied, thanks.

--b.

Quoted 21 lines

---

fs/nfsd/nfsctl.c +1 -3
index 83c82ed..b6e192d 100644
@@ -129,12 +129,10 @@ static ssize_t nfsctl_transaction_read(struct file *file, char __user *buf, size
 {
 	static int warned;
 	if (file->f_dentry->d_name.name[0] == '.' && !warned) {
-		char name[sizeof(current->comm)];
 		printk(KERN_INFO
 		       "Warning: \"%s\" uses deprecated NFSD interface: %s."
 		       "  This will be removed in 2.6.40\n",
-		       get_task_comm(name, current),
-		       file->f_dentry->d_name.name);
+		       current->comm, file->f_dentry->d_name.name);
 		warned = 1;
 	}
 	if (! file->private_data) {