lkml.org 
[lkml]   [2010]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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(&current->fs->lock);
> + *root = current->fs->root;
> + path_get(root);
> + read_unlock(&current->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.



\
 
 \ /
  Last update: 2010-06-15 10:21    [W:0.053 / U:0.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site