diff options
-rw-r--r-- | fs/dcache.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 995d08069d2..f1809e6b9fd 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1970,9 +1970,15 @@ out: return retval; global_root: - retval += 1; /* hit the slash */ - if (prepend_name(&retval, &buflen, &dentry->d_name) != 0) - goto Elong; + /* + * 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); + } root->mnt = vfsmnt; root->dentry = dentry; goto out; |