Re: [PATCH] vfs: remove warning about "weird" root dentry name from prepend_path()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 14 Jan 2013 14:24:58 -0500
Jeff Layton <jlayton@xxxxxxxxxx> wrote:

> On Mon, 14 Jan 2013 16:50:20 +0100
> Miklos Szeredi <miklos@xxxxxxxxxx> wrote:
> 
> > On Mon, Jan 14, 2013 at 3:54 PM, Jeff Layton <jlayton@xxxxxxxxxx> wrote:
> > > We've had several reports of this warning over the last year or so:
> > >
> > > [34011.669912] ------------[ cut here ]------------
> > > [34011.670473] WARNING: at fs/dcache.c:2630 prepend_path+0x1eb/0x200()
> > > [34011.671198] Hardware name: Bochs
> > > [34011.671564] Root dentry has weird name <>  vfsmnt: fs:nfs4
> > 
> > [...]
> > 
> > > I'm able to reproduce this warning at will by mounting up a NFS
> > > filesystem, cd'ing into it. If I then lazy unmount the fs and then stat
> > > /proc/pid/cwd for the process sitting in the detached mount, this
> > > warning will fire.
> > >
> > > Given that this is fairly easy to reproduce without doing anything too
> > > exotic, I don't see much value in keeping this warning around.
> > 
> > The value of the warning is in preventing filesystems from doing weird
> > and exotic things without thinking about it.
> > 
> > The obvious question here is what is NFS4 doing differently from other
> > filesystems to trigger this warning and why.
> > 
> > Thanks,
> > Miklos
> > 
> > >
> > > Cc: Miklos Szeredi <miklos@xxxxxxxxxx>
> > > Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
> > > ---
> > >  fs/dcache.c | 9 ---------
> > >  1 file changed, 9 deletions(-)
> > >
> > > diff --git a/fs/dcache.c b/fs/dcache.c
> > > index 19153a0..08a10a7 100644
> > > --- a/fs/dcache.c
> > > +++ b/fs/dcache.c
> > > @@ -2587,15 +2587,6 @@ out:
> > >         return error;
> > >
> > >  global_root:
> > > -       /*
> > > -        * Filesystems needing to implement special "root names"
> > > -        * should do so with ->d_dname()
> > > -        */
> > > -       if (IS_ROOT(dentry) &&
> > > -           (dentry->d_name.len != 1 || dentry->d_name.name[0] != '/')) {
> > > -               WARN(1, "Root dentry has weird name <%.*s>\n",
> > > -                    (int) dentry->d_name.len, dentry->d_name.name);
> > > -       }
> > >         if (!slash)
> > >                 error = prepend(buffer, buflen, "/", 1);
> > >         if (!error)
> > > --
> > > 1.7.11.7
> > >
> 
> In 3.7-ish kernels, the mnt_root of a NFSv4 mount pointed to a dentry
> with a zero-length name. In 3.8-ish kernels that has changed -- the
> dentry is called '/'. So yeah, it looks like this patch isn't
> necessary.
> 
> The question at this point is why and how that changed. I'm guessing
> I'll have to bisect that down to figure it out. Stay tuned...
> 
> Thanks,

Ok, found it:

commit b911a6bdeef5848c468597d040e3407e0aee04ce
Author: NeilBrown <neilb@xxxxxxx>
Date:   Thu Nov 8 16:09:37 2012 -0800

    vfs: d_obtain_alias() needs to use "/" as default name.
    
Looks like Neil Brown already fixed this the right way. My patch can be
dropped. Sorry for the noise...

Thanks,
-- 
Jeff Layton <jlayton@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux