diff options
author | NeilBrown <neilb@suse.de> | 2012-11-08 16:09:37 -0800 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2013-01-03 03:33:45 +0000 |
commit | 150086ca6bd7493e7753f923a3f55e73701253b3 (patch) | |
tree | aa92b98dfb4446c77f2d8d1a723e02941a0ef6b3 | |
parent | eb73fb3bbd8b65e735896b7c6bcf78130196d4cf (diff) |
vfs: d_obtain_alias() needs to use "/" as default name.
commit b911a6bdeef5848c468597d040e3407e0aee04ce upstream.
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>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
[bwh: Backported to 3.2: use named initialisers instead of QSTR_INIT()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | fs/dcache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 63c0c6b9b82e..bb7f4ccdfbde 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1492,7 +1492,7 @@ static struct dentry * d_find_any_alias(struct inode *inode) */ struct dentry *d_obtain_alias(struct inode *inode) { - static const struct qstr anonstring = { .name = "" }; + static const struct qstr anonstring = { .name = "/", .len = 1 }; struct dentry *tmp; struct dentry *res; |