Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756226Ab0FOISe (ORCPT ); Tue, 15 Jun 2010 04:18:34 -0400 Received: from cantor.suse.de ([195.135.220.2]:35375 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753263Ab0FOISd (ORCPT ); Tue, 15 Jun 2010 04:18:33 -0400 Date: Tue, 15 Jun 2010 18:18:28 +1000 From: Nick Piggin To: Miklos Szeredi Cc: Al Viro , Andrew Morton , John Johansen , Tetsuo Handa , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] vfs: show unreachable paths in getcwd and proc Message-ID: <20100615081828.GG6138@laptop> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1594 Lines: 45 On Fri, Jun 04, 2010 at 01:53:42PM +0200, Miklos Szeredi wrote: > From: Miklos Szeredi > > 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 > --- > 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/