linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] debugfs: Fix !DEBUG_FS debugfs_create_automount
@ 2019-11-21 10:20 Kusanagi Kouichi
  2019-11-21 11:52 ` Greg Kroah-Hartman
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Kusanagi Kouichi @ 2019-11-21 10:20 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Rafael J. Wysocki, Steven Rostedt, Ingo Molnar, linux-kernel

If DEBUG_FS=n, compile fails with the following error:

kernel/trace/trace.c: In function 'tracing_init_dentry':
kernel/trace/trace.c:8658:9: error: passing argument 3 of 'debugfs_create_automount' from incompatible pointer type [-Werror=incompatible-pointer-types]
 8658 |         trace_automount, NULL);
      |         ^~~~~~~~~~~~~~~
      |         |
      |         struct vfsmount * (*)(struct dentry *, void *)
In file included from kernel/trace/trace.c:24:
./include/linux/debugfs.h:206:25: note: expected 'struct vfsmount * (*)(void *)' but argument is of type 'struct vfsmount * (*)(struct dentry *, void *)'
  206 |      struct vfsmount *(*f)(void *),
      |      ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
---
 include/linux/debugfs.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index 58424eb3b329..798f0b9b43ae 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -54,6 +54,8 @@ static const struct file_operations __fops = {				\
 	.llseek  = no_llseek,						\
 }
 
+typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *);
+
 #if defined(CONFIG_DEBUG_FS)
 
 struct dentry *debugfs_lookup(const char *name, struct dentry *parent);
@@ -75,7 +77,6 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);
 struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
 				      const char *dest);
 
-typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *);
 struct dentry *debugfs_create_automount(const char *name,
 					struct dentry *parent,
 					debugfs_automount_t f,
@@ -203,7 +204,7 @@ static inline struct dentry *debugfs_create_symlink(const char *name,
 
 static inline struct dentry *debugfs_create_automount(const char *name,
 					struct dentry *parent,
-					struct vfsmount *(*f)(void *),
+					debugfs_automount_t f,
 					void *data)
 {
 	return ERR_PTR(-ENODEV);
-- 
2.24.0


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

* Re: [PATCH] debugfs: Fix !DEBUG_FS debugfs_create_automount
  2019-11-21 10:20 [PATCH] debugfs: Fix !DEBUG_FS debugfs_create_automount Kusanagi Kouichi
@ 2019-11-21 11:52 ` Greg Kroah-Hartman
  2019-11-21 12:44   ` Kusanagi Kouichi
  2019-11-21 23:53 ` Steven Rostedt
  2019-11-22 16:20 ` Al Viro
  2 siblings, 1 reply; 9+ messages in thread
From: Greg Kroah-Hartman @ 2019-11-21 11:52 UTC (permalink / raw)
  To: Kusanagi Kouichi
  Cc: Rafael J. Wysocki, Steven Rostedt, Ingo Molnar, linux-kernel

On Thu, Nov 21, 2019 at 07:20:21PM +0900, Kusanagi Kouichi wrote:
> If DEBUG_FS=n, compile fails with the following error:
> 
> kernel/trace/trace.c: In function 'tracing_init_dentry':
> kernel/trace/trace.c:8658:9: error: passing argument 3 of 'debugfs_create_automount' from incompatible pointer type [-Werror=incompatible-pointer-types]
>  8658 |         trace_automount, NULL);
>       |         ^~~~~~~~~~~~~~~
>       |         |
>       |         struct vfsmount * (*)(struct dentry *, void *)
> In file included from kernel/trace/trace.c:24:
> ./include/linux/debugfs.h:206:25: note: expected 'struct vfsmount * (*)(void *)' but argument is of type 'struct vfsmount * (*)(struct dentry *, void *)'
>   206 |      struct vfsmount *(*f)(void *),
>       |      ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
> 
> Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
> ---
>  include/linux/debugfs.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Has this always been a problem, or did it just show up due to some other
kernel change?

thanks,

greg k-h

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

* Re: [PATCH] debugfs: Fix !DEBUG_FS debugfs_create_automount
  2019-11-21 11:52 ` Greg Kroah-Hartman
@ 2019-11-21 12:44   ` Kusanagi Kouichi
  2019-11-21 13:26     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 9+ messages in thread
From: Kusanagi Kouichi @ 2019-11-21 12:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Rafael J. Wysocki, Steven Rostedt, Ingo Molnar, linux-kernel

On 2019-11-21 12:52:32 +0100, Greg Kroah-Hartman wrote:
> 
> Has this always been a problem, or did it just show up due to some other
> kernel change?
> 

The latter. Please see https://lkml.org/lkml/2019/11/21/11

> thanks,
> 
> greg k-h

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

* Re: [PATCH] debugfs: Fix !DEBUG_FS debugfs_create_automount
  2019-11-21 12:44   ` Kusanagi Kouichi
@ 2019-11-21 13:26     ` Greg Kroah-Hartman
  2019-11-21 23:55       ` Steven Rostedt
  0 siblings, 1 reply; 9+ messages in thread
From: Greg Kroah-Hartman @ 2019-11-21 13:26 UTC (permalink / raw)
  To: Kusanagi Kouichi
  Cc: Rafael J. Wysocki, Steven Rostedt, Ingo Molnar, linux-kernel

On Thu, Nov 21, 2019 at 09:44:13PM +0900, Kusanagi Kouichi wrote:
> On 2019-11-21 12:52:32 +0100, Greg Kroah-Hartman wrote:
> > 
> > Has this always been a problem, or did it just show up due to some other
> > kernel change?
> > 
> 
> The latter. Please see https://lkml.org/lkml/2019/11/21/11

So it is fine for this to go into 5.5-rc1 then, right?  I'll queue it up
that way.

thanks,

greg k-h

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

* Re: [PATCH] debugfs: Fix !DEBUG_FS debugfs_create_automount
  2019-11-21 10:20 [PATCH] debugfs: Fix !DEBUG_FS debugfs_create_automount Kusanagi Kouichi
  2019-11-21 11:52 ` Greg Kroah-Hartman
@ 2019-11-21 23:53 ` Steven Rostedt
  2019-11-22 16:20 ` Al Viro
  2 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2019-11-21 23:53 UTC (permalink / raw)
  To: Kusanagi Kouichi
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Ingo Molnar, linux-kernel

On Thu, 21 Nov 2019 19:20:21 +0900
Kusanagi Kouichi <slash@ac.auone-net.jp> wrote:

> If DEBUG_FS=n, compile fails with the following error:
> 
> kernel/trace/trace.c: In function 'tracing_init_dentry':
> kernel/trace/trace.c:8658:9: error: passing argument 3 of 'debugfs_create_automount' from incompatible pointer type [-Werror=incompatible-pointer-types]
>  8658 |         trace_automount, NULL);
>       |         ^~~~~~~~~~~~~~~
>       |         |
>       |         struct vfsmount * (*)(struct dentry *, void *)
> In file included from kernel/trace/trace.c:24:
> ./include/linux/debugfs.h:206:25: note: expected 'struct vfsmount * (*)(void *)' but argument is of type 'struct vfsmount * (*)(struct dentry *, void *)'
>   206 |      struct vfsmount *(*f)(void *),
>       |      ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
> 

Please add the tag:

 Reported-by: kbuild test robot <lkp@intel.com>

You can also add:

 Link: https://lore.kernel.org/lkml/201911211354.zYtbB4MD%25lkp@intel.com/

-- Steve

> Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
> ---
>  include/linux/debugfs.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
> index 58424eb3b329..798f0b9b43ae 100644
> --- a/include/linux/debugfs.h
> +++ b/include/linux/debugfs.h
> @@ -54,6 +54,8 @@ static const struct file_operations __fops = {				\
>  	.llseek  = no_llseek,						\
>  }
>  
> +typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *);
> +
>  #if defined(CONFIG_DEBUG_FS)
>  
>  struct dentry *debugfs_lookup(const char *name, struct dentry *parent);
> @@ -75,7 +77,6 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);
>  struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
>  				      const char *dest);
>  
> -typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *);
>  struct dentry *debugfs_create_automount(const char *name,
>  					struct dentry *parent,
>  					debugfs_automount_t f,
> @@ -203,7 +204,7 @@ static inline struct dentry *debugfs_create_symlink(const char *name,
>  
>  static inline struct dentry *debugfs_create_automount(const char *name,
>  					struct dentry *parent,
> -					struct vfsmount *(*f)(void *),
> +					debugfs_automount_t f,
>  					void *data)
>  {
>  	return ERR_PTR(-ENODEV);


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

* Re: [PATCH] debugfs: Fix !DEBUG_FS debugfs_create_automount
  2019-11-21 13:26     ` Greg Kroah-Hartman
@ 2019-11-21 23:55       ` Steven Rostedt
  2019-11-22 15:19         ` Greg Kroah-Hartman
  0 siblings, 1 reply; 9+ messages in thread
From: Steven Rostedt @ 2019-11-21 23:55 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Kusanagi Kouichi, Rafael J. Wysocki, Ingo Molnar, linux-kernel

On Thu, 21 Nov 2019 14:26:44 +0100
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> On Thu, Nov 21, 2019 at 09:44:13PM +0900, Kusanagi Kouichi wrote:
> > On 2019-11-21 12:52:32 +0100, Greg Kroah-Hartman wrote:  
> > > 
> > > Has this always been a problem, or did it just show up due to some other
> > > kernel change?
> > >   
> > 
> > The latter. Please see https://lkml.org/lkml/2019/11/21/11  
> 
> So it is fine for this to go into 5.5-rc1 then, right?  I'll queue it up
> that way.

As the following patch also relies on this fix, can you add this too:

 https://lore.kernel.org/lkml/20191120104350753.EWCT.12796.ppp.dion.ne.jp@dmta0009.auone-net.jp/

And add my Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

I'm haven't run these through my tests yet, but I'm going to (which
takes 13 hours), just to make sure, but I don't expect it to find
anything. But if it does, I'll let you know.

Thanks!

-- Steve

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

* Re: [PATCH] debugfs: Fix !DEBUG_FS debugfs_create_automount
  2019-11-21 23:55       ` Steven Rostedt
@ 2019-11-22 15:19         ` Greg Kroah-Hartman
  2019-11-24  1:11           ` Steven Rostedt
  0 siblings, 1 reply; 9+ messages in thread
From: Greg Kroah-Hartman @ 2019-11-22 15:19 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Kusanagi Kouichi, Rafael J. Wysocki, Ingo Molnar, linux-kernel

On Thu, Nov 21, 2019 at 06:55:40PM -0500, Steven Rostedt wrote:
> On Thu, 21 Nov 2019 14:26:44 +0100
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> 
> > On Thu, Nov 21, 2019 at 09:44:13PM +0900, Kusanagi Kouichi wrote:
> > > On 2019-11-21 12:52:32 +0100, Greg Kroah-Hartman wrote:  
> > > > 
> > > > Has this always been a problem, or did it just show up due to some other
> > > > kernel change?
> > > >   
> > > 
> > > The latter. Please see https://lkml.org/lkml/2019/11/21/11  
> > 
> > So it is fine for this to go into 5.5-rc1 then, right?  I'll queue it up
> > that way.
> 
> As the following patch also relies on this fix, can you add this too:
> 
>  https://lore.kernel.org/lkml/20191120104350753.EWCT.12796.ppp.dion.ne.jp@dmta0009.auone-net.jp/
> 
> And add my Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

Now queued up, thanks!

greg k-h

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

* Re: [PATCH] debugfs: Fix !DEBUG_FS debugfs_create_automount
  2019-11-21 10:20 [PATCH] debugfs: Fix !DEBUG_FS debugfs_create_automount Kusanagi Kouichi
  2019-11-21 11:52 ` Greg Kroah-Hartman
  2019-11-21 23:53 ` Steven Rostedt
@ 2019-11-22 16:20 ` Al Viro
  2 siblings, 0 replies; 9+ messages in thread
From: Al Viro @ 2019-11-22 16:20 UTC (permalink / raw)
  To: Kusanagi Kouichi
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Steven Rostedt,
	Ingo Molnar, linux-kernel

On Thu, Nov 21, 2019 at 07:20:21PM +0900, Kusanagi Kouichi wrote:
> If DEBUG_FS=n, compile fails with the following error:
> 
> kernel/trace/trace.c: In function 'tracing_init_dentry':
> kernel/trace/trace.c:8658:9: error: passing argument 3 of 'debugfs_create_automount' from incompatible pointer type [-Werror=incompatible-pointer-types]
>  8658 |         trace_automount, NULL);
>       |         ^~~~~~~~~~~~~~~
>       |         |
>       |         struct vfsmount * (*)(struct dentry *, void *)
> In file included from kernel/trace/trace.c:24:
> ./include/linux/debugfs.h:206:25: note: expected 'struct vfsmount * (*)(void *)' but argument is of type 'struct vfsmount * (*)(struct dentry *, void *)'
>   206 |      struct vfsmount *(*f)(void *),
>       |      ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

ACK.  I'd probably add something along the lines of "the stub for
debugfs_create_automount() used in !DEBUG_FS configs is misdeclared -
its callback argument (unused by the stub) has the wrong type.
Get the stub in sync with the real debugfs_create_automount()."
to commit message.

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

* Re: [PATCH] debugfs: Fix !DEBUG_FS debugfs_create_automount
  2019-11-22 15:19         ` Greg Kroah-Hartman
@ 2019-11-24  1:11           ` Steven Rostedt
  0 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2019-11-24  1:11 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Kusanagi Kouichi, Rafael J. Wysocki, Ingo Molnar, linux-kernel

On Fri, 22 Nov 2019 16:19:26 +0100
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> > As the following patch also relies on this fix, can you add this too:
> > 
> >  https://lore.kernel.org/lkml/20191120104350753.EWCT.12796.ppp.dion.ne.jp@dmta0009.auone-net.jp/
> > 
> > And add my Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>  
> 
> Now queued up, thanks!

Thanks, and FYI, I ran this through all my tests and it passed (both patches together).

-- Steve

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

end of thread, other threads:[~2019-11-24  1:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-21 10:20 [PATCH] debugfs: Fix !DEBUG_FS debugfs_create_automount Kusanagi Kouichi
2019-11-21 11:52 ` Greg Kroah-Hartman
2019-11-21 12:44   ` Kusanagi Kouichi
2019-11-21 13:26     ` Greg Kroah-Hartman
2019-11-21 23:55       ` Steven Rostedt
2019-11-22 15:19         ` Greg Kroah-Hartman
2019-11-24  1:11           ` Steven Rostedt
2019-11-21 23:53 ` Steven Rostedt
2019-11-22 16:20 ` Al Viro

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