]> git.karo-electronics.de Git - karo-tx-linux.git/commit
vfs: d_obtain_alias() needs to use "/" as default name.
authorNeilBrown <neilb@suse.de>
Fri, 28 Sep 2012 00:18:47 +0000 (10:18 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 5 Oct 2012 04:00:37 +0000 (14:00 +1000)
commit993df1af85a167fc9191487d1fa90cc9524c77bf
treebf7a3936528b1b33459ed344620cd563d0a0c0c1
parent8c6d74b2f0ffe4e585980ca5c453ce7361b41dc0
vfs: d_obtain_alias() needs to use "/" as default name.

NFS appears to use d_obtain_alias() to create the root dentry rather than
d_make_root.  This can cause 'prepend_path()' to complain that the root
has a weird name if an NFS filesystem is lazily unmounted.  e.g.  if
"/mnt" is an NFS mount then

 { cd /mnt; umount -l /mnt ; ls -l /proc/self/cwd; }

will cause a WARN message like
   WARNING: at /home/git/linux/fs/dcache.c:2624 prepend_path+0x1d7/0x1e0()
   ...
   Root dentry has weird name <>

to appear in kernel logs.

So change d_obtain_alias() to use "/" rather than "" as the anonymous
name.

Signed-off-by: NeilBrown <neilb@suse.de>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/dcache.c