linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xenbus: Use proc_create_mount_point() to create /proc/xen
@ 2016-08-29 15:03 Seth Forshee
  2016-08-30 14:48 ` Juergen Gross
  2016-08-30 15:00 ` [Xen-devel] " David Vrabel
  0 siblings, 2 replies; 6+ messages in thread
From: Seth Forshee @ 2016-08-29 15:03 UTC (permalink / raw)
  To: Eric W. Biederman, Boris Ostrovsky, David Vrabel, Juergen Gross
  Cc: Seth Forshee, xen-devel, linux-kernel

Mounting proc in user namespace containers fails if the xenbus
filesystem is mounted on /proc/xen because this directory fails
the "permanently empty" test. proc_create_mount_point() exists
specifically to create such mountpoints in proc but is currently
proc-internal. Export this interface to modules, then use it in
xenbus when creating /proc/xen.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
---
 drivers/xen/xenbus/xenbus_probe.c | 2 +-
 fs/proc/generic.c                 | 1 +
 fs/proc/internal.h                | 1 -
 include/linux/proc_fs.h           | 2 ++
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index 33a31cfef55d..b5c1dec4a7c2 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -826,7 +826,7 @@ static int __init xenbus_init(void)
 	 * Create xenfs mountpoint in /proc for compatibility with
 	 * utilities that expect to find "xenbus" under "/proc/xen".
 	 */
-	proc_mkdir("xen", NULL);
+	proc_create_mount_point("xen");
 #endif
 
 out_error:
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index c633476616e0..be014c544d50 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -477,6 +477,7 @@ struct proc_dir_entry *proc_create_mount_point(const char *name)
 	}
 	return ent;
 }
+EXPORT_SYMBOL(proc_create_mount_point);
 
 struct proc_dir_entry *proc_create_data(const char *name, umode_t mode,
 					struct proc_dir_entry *parent,
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index 7931c558c192..ff7259559d70 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -195,7 +195,6 @@ static inline bool is_empty_pde(const struct proc_dir_entry *pde)
 {
 	return S_ISDIR(pde->mode) && !pde->proc_iops;
 }
-struct proc_dir_entry *proc_create_mount_point(const char *name);
 
 /*
  * inode.c
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index b97bf2ef996e..8bd2f726436a 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -21,6 +21,7 @@ extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t,
 					      struct proc_dir_entry *, void *);
 extern struct proc_dir_entry *proc_mkdir_mode(const char *, umode_t,
 					      struct proc_dir_entry *);
+struct proc_dir_entry *proc_create_mount_point(const char *name);
  
 extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
 					       struct proc_dir_entry *,
@@ -56,6 +57,7 @@ static inline struct proc_dir_entry *proc_symlink(const char *name,
 		struct proc_dir_entry *parent,const char *dest) { return NULL;}
 static inline struct proc_dir_entry *proc_mkdir(const char *name,
 	struct proc_dir_entry *parent) {return NULL;}
+static inline struct proc_dir_entry *proc_create_mount_point(const char *name) { return NULL; }
 static inline struct proc_dir_entry *proc_mkdir_data(const char *name,
 	umode_t mode, struct proc_dir_entry *parent, void *data) { return NULL; }
 static inline struct proc_dir_entry *proc_mkdir_mode(const char *name,
-- 
2.7.4

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

* Re: [PATCH] xenbus: Use proc_create_mount_point() to create /proc/xen
  2016-08-29 15:03 [PATCH] xenbus: Use proc_create_mount_point() to create /proc/xen Seth Forshee
@ 2016-08-30 14:48 ` Juergen Gross
  2016-08-30 15:02   ` Seth Forshee
  2016-08-30 15:00 ` [Xen-devel] " David Vrabel
  1 sibling, 1 reply; 6+ messages in thread
From: Juergen Gross @ 2016-08-30 14:48 UTC (permalink / raw)
  To: Seth Forshee, Eric W. Biederman, Boris Ostrovsky, David Vrabel
  Cc: xen-devel, linux-kernel

On 29/08/16 17:03, Seth Forshee wrote:
> Mounting proc in user namespace containers fails if the xenbus
> filesystem is mounted on /proc/xen because this directory fails
> the "permanently empty" test. proc_create_mount_point() exists
> specifically to create such mountpoints in proc but is currently
> proc-internal. Export this interface to modules, then use it in
> xenbus when creating /proc/xen.
> 
> Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
> ---
>  drivers/xen/xenbus/xenbus_probe.c | 2 +-
>  fs/proc/generic.c                 | 1 +
>  fs/proc/internal.h                | 1 -
>  include/linux/proc_fs.h           | 2 ++
>  4 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
> index 33a31cfef55d..b5c1dec4a7c2 100644
> --- a/drivers/xen/xenbus/xenbus_probe.c
> +++ b/drivers/xen/xenbus/xenbus_probe.c
> @@ -826,7 +826,7 @@ static int __init xenbus_init(void)
>  	 * Create xenfs mountpoint in /proc for compatibility with
>  	 * utilities that expect to find "xenbus" under "/proc/xen".
>  	 */
> -	proc_mkdir("xen", NULL);
> +	proc_create_mount_point("xen");
>  #endif
>  
>  out_error:
> diff --git a/fs/proc/generic.c b/fs/proc/generic.c
> index c633476616e0..be014c544d50 100644
> --- a/fs/proc/generic.c
> +++ b/fs/proc/generic.c
> @@ -477,6 +477,7 @@ struct proc_dir_entry *proc_create_mount_point(const char *name)
>  	}
>  	return ent;
>  }
> +EXPORT_SYMBOL(proc_create_mount_point);

EXPORT_SYMBOL_GPL()?

Juergen

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

* Re: [Xen-devel] [PATCH] xenbus: Use proc_create_mount_point() to create /proc/xen
  2016-08-29 15:03 [PATCH] xenbus: Use proc_create_mount_point() to create /proc/xen Seth Forshee
  2016-08-30 14:48 ` Juergen Gross
@ 2016-08-30 15:00 ` David Vrabel
  2016-08-30 15:10   ` Seth Forshee
  1 sibling, 1 reply; 6+ messages in thread
From: David Vrabel @ 2016-08-30 15:00 UTC (permalink / raw)
  To: Seth Forshee, Eric W. Biederman, Boris Ostrovsky, David Vrabel,
	Juergen Gross
  Cc: linux-kernel, xen-devel

On 29/08/16 16:03, Seth Forshee wrote:
> Mounting proc in user namespace containers fails if the xenbus
> filesystem is mounted on /proc/xen because this directory fails
> the "permanently empty" test. proc_create_mount_point() exists
> specifically to create such mountpoints in proc but is currently
> proc-internal. Export this interface to modules, then use it in
> xenbus when creating /proc/xen.

Acked-by: David Vrabel <david.vrabel@citrix.com>

This either needs to be acked by the fs maintainer or go via their tree
but you don't appear to have Cc'd the relevant people or lists.

David

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

* Re: [PATCH] xenbus: Use proc_create_mount_point() to create /proc/xen
  2016-08-30 14:48 ` Juergen Gross
@ 2016-08-30 15:02   ` Seth Forshee
  0 siblings, 0 replies; 6+ messages in thread
From: Seth Forshee @ 2016-08-30 15:02 UTC (permalink / raw)
  To: Juergen Gross
  Cc: Eric W. Biederman, Boris Ostrovsky, David Vrabel, xen-devel,
	linux-kernel

On Tue, Aug 30, 2016 at 04:48:08PM +0200, Juergen Gross wrote:
> On 29/08/16 17:03, Seth Forshee wrote:
> > Mounting proc in user namespace containers fails if the xenbus
> > filesystem is mounted on /proc/xen because this directory fails
> > the "permanently empty" test. proc_create_mount_point() exists
> > specifically to create such mountpoints in proc but is currently
> > proc-internal. Export this interface to modules, then use it in
> > xenbus when creating /proc/xen.
> > 
> > Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
> > ---
> >  drivers/xen/xenbus/xenbus_probe.c | 2 +-
> >  fs/proc/generic.c                 | 1 +
> >  fs/proc/internal.h                | 1 -
> >  include/linux/proc_fs.h           | 2 ++
> >  4 files changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
> > index 33a31cfef55d..b5c1dec4a7c2 100644
> > --- a/drivers/xen/xenbus/xenbus_probe.c
> > +++ b/drivers/xen/xenbus/xenbus_probe.c
> > @@ -826,7 +826,7 @@ static int __init xenbus_init(void)
> >  	 * Create xenfs mountpoint in /proc for compatibility with
> >  	 * utilities that expect to find "xenbus" under "/proc/xen".
> >  	 */
> > -	proc_mkdir("xen", NULL);
> > +	proc_create_mount_point("xen");
> >  #endif
> >  
> >  out_error:
> > diff --git a/fs/proc/generic.c b/fs/proc/generic.c
> > index c633476616e0..be014c544d50 100644
> > --- a/fs/proc/generic.c
> > +++ b/fs/proc/generic.c
> > @@ -477,6 +477,7 @@ struct proc_dir_entry *proc_create_mount_point(const char *name)
> >  	}
> >  	return ent;
> >  }
> > +EXPORT_SYMBOL(proc_create_mount_point);
> 
> EXPORT_SYMBOL_GPL()?

Other similar sorts of calls in proc (proc_mkdir in particular) are
EXPORT_SYMBOL, so I guessed this one should follow suit. But if it
should be EXPORT_SYMOBL_GPL then that's fine too.

Thanks,
Seth

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

* Re: [Xen-devel] [PATCH] xenbus: Use proc_create_mount_point() to create /proc/xen
  2016-08-30 15:00 ` [Xen-devel] " David Vrabel
@ 2016-08-30 15:10   ` Seth Forshee
  2016-08-30 15:13     ` David Vrabel
  0 siblings, 1 reply; 6+ messages in thread
From: Seth Forshee @ 2016-08-30 15:10 UTC (permalink / raw)
  To: David Vrabel
  Cc: Eric W. Biederman, Boris Ostrovsky, Juergen Gross, linux-kernel,
	xen-devel

On Tue, Aug 30, 2016 at 04:00:03PM +0100, David Vrabel wrote:
> On 29/08/16 16:03, Seth Forshee wrote:
> > Mounting proc in user namespace containers fails if the xenbus
> > filesystem is mounted on /proc/xen because this directory fails
> > the "permanently empty" test. proc_create_mount_point() exists
> > specifically to create such mountpoints in proc but is currently
> > proc-internal. Export this interface to modules, then use it in
> > xenbus when creating /proc/xen.
> 
> Acked-by: David Vrabel <david.vrabel@citrix.com>
> 
> This either needs to be acked by the fs maintainer or go via their tree
> but you don't appear to have Cc'd the relevant people or lists.

Huh. I use a script which uses get_maintainer.pl to add the relevant
maintainers and lists, but appaerntly that failed me this time. Even
running get_maintainer.pl by hand though it doesn't suggest
linux-fsdevel though, and it seems it should.

Thanks,
Seth

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

* Re: [Xen-devel] [PATCH] xenbus: Use proc_create_mount_point() to create /proc/xen
  2016-08-30 15:10   ` Seth Forshee
@ 2016-08-30 15:13     ` David Vrabel
  0 siblings, 0 replies; 6+ messages in thread
From: David Vrabel @ 2016-08-30 15:13 UTC (permalink / raw)
  To: Seth Forshee
  Cc: Eric W. Biederman, Boris Ostrovsky, Juergen Gross, linux-kernel,
	xen-devel

On 30/08/16 16:10, Seth Forshee wrote:
> On Tue, Aug 30, 2016 at 04:00:03PM +0100, David Vrabel wrote:
>> On 29/08/16 16:03, Seth Forshee wrote:
>>> Mounting proc in user namespace containers fails if the xenbus
>>> filesystem is mounted on /proc/xen because this directory fails
>>> the "permanently empty" test. proc_create_mount_point() exists
>>> specifically to create such mountpoints in proc but is currently
>>> proc-internal. Export this interface to modules, then use it in
>>> xenbus when creating /proc/xen.
>>
>> Acked-by: David Vrabel <david.vrabel@citrix.com>
>>
>> This either needs to be acked by the fs maintainer or go via their tree
>> but you don't appear to have Cc'd the relevant people or lists.
> 
> Huh. I use a script which uses get_maintainer.pl to add the relevant
> maintainers and lists, but appaerntly that failed me this time. Even
> running get_maintainer.pl by hand though it doesn't suggest
> linux-fsdevel though, and it seems it should.

I tend not rely on get_maintainer.pl because it isn't very reliable.
>From MAINTAINERS you want:

FILESYSTEMS (VFS and infrastructure)
M:      Alexander Viro <viro@zeniv.linux.org.uk>
L:      linux-fsdevel@vger.kernel.org
S:      Maintained
F:      fs/*

David

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

end of thread, other threads:[~2016-08-30 15:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-29 15:03 [PATCH] xenbus: Use proc_create_mount_point() to create /proc/xen Seth Forshee
2016-08-30 14:48 ` Juergen Gross
2016-08-30 15:02   ` Seth Forshee
2016-08-30 15:00 ` [Xen-devel] " David Vrabel
2016-08-30 15:10   ` Seth Forshee
2016-08-30 15:13     ` David Vrabel

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