Messages in this thread | | | Date | Tue, 15 Jun 2010 18:18:28 +1000 | From | Nick Piggin <> | Subject | Re: [PATCH 2/2] vfs: show unreachable paths in getcwd and proc |
| |
On Fri, Jun 04, 2010 at 01:53:42PM +0200, Miklos Szeredi wrote: > From: Miklos Szeredi <mszeredi@suse.cz> > > Prepend "(unreachable)" to path strings if the path is not reachable > from the current root. > > Two places updated are > - the return string from getcwd() > - and symlinks under /proc/$PID. > > Other uses of d_path() are left unchanged (we know that some old > software crashes if /proc/mounts is changed). > > Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> > --- > fs/dcache.c | 82 +++++++++++++++++++++++++++++++++++++++++-------- > fs/proc/base.c | 2 - > include/linux/dcache.h | 1 > 3 files changed, 72 insertions(+), 13 deletions(-) > > Index: linux-2.6/fs/dcache.c > =================================================================== > --- linux-2.6.orig/fs/dcache.c 2010-05-27 12:22:21.000000000 +0200 > +++ linux-2.6/fs/dcache.c 2010-05-27 12:22:24.000000000 +0200 > @@ -1957,6 +1957,33 @@ int __d_path(const struct path *path, st > return error; > } > > +static void current_root(struct path *root) > +{ > + read_lock(¤t->fs->lock); > + *root = current->fs->root; > + path_get(root); > + read_unlock(¤t->fs->lock); > +}
Does this really need a helper? If yes, then please put matching get_fs_{root,pwd,both} helpers into fs_struct.c and use them throughout the tree.
| |