Linux NFS development
 help / color / mirror / Atom feed
* [PATCH nfsd-next] nfsd: Export get_task_comm for nfsd
@ 2010-09-23  9:01 Pavel Emelyanov
  2010-09-23 14:05 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Emelyanov @ 2010-09-23  9:01 UTC (permalink / raw)
  To: J. Bruce Fields, linux-nfs

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.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

diff --git a/fs/exec.c b/fs/exec.c
index 828dd24..1d22c4b 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -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)
 {

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

* Re: [PATCH nfsd-next] nfsd: Export get_task_comm for nfsd
  2010-09-23  9:01 [PATCH nfsd-next] nfsd: Export get_task_comm for nfsd Pavel Emelyanov
@ 2010-09-23 14:05 ` Christoph Hellwig
  2010-09-23 14:26   ` Pavel Emelyanov
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2010-09-23 14:05 UTC (permalink / raw)
  To: Pavel Emelyanov; +Cc: J. Bruce Fields, linux-nfs

On Thu, Sep 23, 2010 at 01:01:34PM +0400, Pavel Emelyanov wrote:
> 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.

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

* Re: [PATCH nfsd-next] nfsd: Export get_task_comm for nfsd
  2010-09-23 14:05 ` Christoph Hellwig
@ 2010-09-23 14:26   ` Pavel Emelyanov
  2010-09-23 14:39     ` J. Bruce Fields
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Emelyanov @ 2010-09-23 14:26 UTC (permalink / raw)
  To: Christoph Hellwig, J. Bruce Fields; +Cc: linux-nfs

> 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.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 83c82ed..b6e192d 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -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) {

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

* Re: [PATCH nfsd-next] nfsd: Export get_task_comm for nfsd
  2010-09-23 14:26   ` Pavel Emelyanov
@ 2010-09-23 14:39     ` J. Bruce Fields
  0 siblings, 0 replies; 4+ messages in thread
From: J. Bruce Fields @ 2010-09-23 14:39 UTC (permalink / raw)
  To: Pavel Emelyanov; +Cc: Christoph Hellwig, linux-nfs

On Thu, Sep 23, 2010 at 06:26:58PM +0400, Pavel Emelyanov wrote:
> > 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.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Applied, thanks.

--b.

> 
> ---
> 
> diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
> index 83c82ed..b6e192d 100644
> --- a/fs/nfsd/nfsctl.c
> +++ b/fs/nfsd/nfsctl.c
> @@ -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) {

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

end of thread, other threads:[~2010-09-23 14:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-23  9:01 [PATCH nfsd-next] nfsd: Export get_task_comm for nfsd Pavel Emelyanov
2010-09-23 14:05 ` Christoph Hellwig
2010-09-23 14:26   ` Pavel Emelyanov
2010-09-23 14:39     ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox