]> 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, 9 Nov 2012 03:03:45 +0000 (14:03 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 12 Nov 2012 04:15:14 +0000 (15:15 +1100)
commita49d76e40f5f86e0e0dca40db92a0515e11b92a9
tree88804b8cacacef719be2d6971ca1c1ae78a9e6b4
parent62298631907d1c018dcdd22b5d01dc518db34aa6
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>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/dcache.c