vfs: __d_path: dont prepend the name of the root dentry
[pandora-kernel.git] / fs / dcache.c
index 995d080..f1809e6 100644 (file)
@@ -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;