d_path broken

Andreas Schwab (schwab@issan.informatik.uni-dortmund.de)
Wed, 23 Jul 97 11:18:48 +0200


The d_path function does not do what it is supposed to do. It only
returns the part of the file name below the next mount point, excluding
the path to the mount point itself. Here's a patch:

--- linux-2.1.46/fs/dcache.c.~1~ Fri Jul 18 18:03:03 1997
+++ linux-2.1.46/fs/dcache.c Tue Jul 22 16:02:23 1997
@@ -315,7 +315,12 @@

int d_path(struct dentry * entry, struct dentry * chroot, char * buf)
{
- if (IS_ROOT(entry) || (chroot && entry == chroot)) {
+ if (chroot && entry == chroot) {
+ *buf = '/';
+ return 1;
+ } else if (IS_ROOT(entry)) {
+ if (entry->d_covers != entry)
+ return d_path(entry->d_covers, chroot, buf);
*buf = '/';
return 1;
} else {

-- 
Andreas Schwab                                      "And now for something
schwab@issan.informatik.uni-dortmund.de              completely different"