From: Nick Piggin <npiggin@suse.de>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
Andrew Morton <akpm@linux-foundation.org>,
John Johansen <john.johansen@canonical.com>,
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] vfs: show unreachable paths in getcwd and proc
Date: Tue, 15 Jun 2010 18:18:28 +1000 [thread overview]
Message-ID: <20100615081828.GG6138@laptop> (raw)
In-Reply-To: <E1OKVT4-0002bA-KD@pomaz-ex.szeredi.hu>
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.
next prev parent reply other threads:[~2010-06-15 8:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-04 11:52 [PATCH 1/2] vfs: sanitize __d_path() Miklos Szeredi
2010-06-04 11:53 ` [PATCH 2/2] vfs: show unreachable paths in getcwd and proc Miklos Szeredi
2010-06-15 7:31 ` Miklos Szeredi
2010-06-15 8:18 ` Nick Piggin [this message]
2010-06-04 14:10 ` [PATCH 1/2] vfs: sanitize __d_path() Tetsuo Handa
-- strict thread matches above, loose matches on Subject: below --
2010-05-27 10:29 Miklos Szeredi
2010-05-27 10:30 ` [PATCH 2/2] vfs: show unreachable paths in getcwd and proc Miklos Szeredi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100615081828.GG6138@laptop \
--to=npiggin@suse.de \
--cc=akpm@linux-foundation.org \
--cc=john.johansen@canonical.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=viro@ZenIV.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).