linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -mmotm] fs/sysfs/file.c d_path fix
@ 2008-02-16 19:12 Erez Zadok
  2008-02-17 13:07 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Erez Zadok @ 2008-02-16 19:12 UTC (permalink / raw)
  To: Andrew Morton, jblunck, hch; +Cc: linux-kernel

Using mmotm-2008-02-15-11-03, I get

  CC      fs/sysfs/file.o
fs/sysfs/file.c: In function 'sysfs_open_file':
fs/sysfs/file.c:334: warning: passing argument 1 of 'd_path' from incompatible pointer type
fs/sysfs/file.c:334: warning: passing argument 2 of 'd_path' from incompatible pointer type
fs/sysfs/file.c:334: warning: passing argument 3 of 'd_path' makes integer from pointer without a cast
fs/sysfs/file.c:334: error: too many arguments to function 'd_path'
make[2]: *** [fs/sysfs/file.o] Error 1
make[1]: *** [fs/sysfs] Error 2
make: *** [fs] Error 2

The following small patch fixes it for me.

Cheers,
Erez.


Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>

diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 02223e2..a57b024 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -329,9 +329,11 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
 	struct sysfs_ops *ops;
 	int error = -EACCES;
 	char *p;
+	struct path sysfs_path;
 
-	p = d_path(file->f_dentry, sysfs_mount, last_sysfs_file,
-		   sizeof(last_sysfs_file));
+	sysfs_path.dentry = file->f_dentry;
+	sysfs_path.mnt = sysfs_mount;
+	p = d_path(&sysfs_path, last_sysfs_file, sizeof(last_sysfs_file));
 	if (p)
 		memmove(last_sysfs_file, p, strlen(p) + 1);
 

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

* Re: [PATCH -mmotm] fs/sysfs/file.c d_path fix
  2008-02-16 19:12 [PATCH -mmotm] fs/sysfs/file.c d_path fix Erez Zadok
@ 2008-02-17 13:07 ` Christoph Hellwig
  2008-02-18 16:44   ` Jan Blunck
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2008-02-17 13:07 UTC (permalink / raw)
  To: Erez Zadok; +Cc: Andrew Morton, jblunck, hch, linux-kernel

On Sat, Feb 16, 2008 at 02:12:05PM -0500, Erez Zadok wrote:
> diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
> index 02223e2..a57b024 100644
> --- a/fs/sysfs/file.c
> +++ b/fs/sysfs/file.c
> @@ -329,9 +329,11 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
>  	struct sysfs_ops *ops;
>  	int error = -EACCES;
>  	char *p;
> +	struct path sysfs_path;
>  
> -	p = d_path(file->f_dentry, sysfs_mount, last_sysfs_file,
> -		   sizeof(last_sysfs_file));
> +	sysfs_path.dentry = file->f_dentry;
> +	sysfs_path.mnt = sysfs_mount;
> +	p = d_path(&sysfs_path, last_sysfs_file, sizeof(last_sysfs_file));

A d_path(file->f_path, ..); should do it, but I'd really like to know
what sysfs crowd was smoking when adding a d_path in ->open.  Guys,
please explain what's going on here.


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

* Re: [PATCH -mmotm] fs/sysfs/file.c d_path fix
  2008-02-17 13:07 ` Christoph Hellwig
@ 2008-02-18 16:44   ` Jan Blunck
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Blunck @ 2008-02-18 16:44 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Erez Zadok, Andrew Morton, linux-kernel

On Sun, Feb 17, Christoph Hellwig wrote:

> On Sat, Feb 16, 2008 at 02:12:05PM -0500, Erez Zadok wrote:
> > diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
> > index 02223e2..a57b024 100644
> > --- a/fs/sysfs/file.c
> > +++ b/fs/sysfs/file.c
> > @@ -329,9 +329,11 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
> >  	struct sysfs_ops *ops;
> >  	int error = -EACCES;
> >  	char *p;
> > +	struct path sysfs_path;
> >  
> > -	p = d_path(file->f_dentry, sysfs_mount, last_sysfs_file,
> > -		   sizeof(last_sysfs_file));
> > +	sysfs_path.dentry = file->f_dentry;
> > +	sysfs_path.mnt = sysfs_mount;
> > +	p = d_path(&sysfs_path, last_sysfs_file, sizeof(last_sysfs_file));
> 
> A d_path(file->f_path, ..); should do it, but I'd really like to know
> what sysfs crowd was smoking when adding a d_path in ->open.  Guys,
> please explain what's going on here.
> 

This is from gregkh-driver-sysfs-crash-debugging.patch which is only in -mm I
guess.

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

end of thread, other threads:[~2008-02-18 16:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-16 19:12 [PATCH -mmotm] fs/sysfs/file.c d_path fix Erez Zadok
2008-02-17 13:07 ` Christoph Hellwig
2008-02-18 16:44   ` Jan Blunck

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