There is a check in the function implementing readdir(3) for a zero
inode number:

struct dirent *
_readdir_unlocked(dirp, skip)
        DIR *dirp;
        int skip;
{
        /* ... */
                if (dp->d_ino == 0 && skip)
                        continue;
        /* ... */
}

"skip" is 1 except for when coming from _seekdir(3).

I don't recall any requirement that a filesystem not use an inode
numbered 0, though for obvious reasons it's a poor choice for a file's
inode.  So... is this code in libc incorrect?  Or is there
documentation that 0 cannot be a valid inode number for a filesystem?

If 0 cannot be a valid inode number, my GSoC mentee Gleb suggested
d_fileno == 0 be skipped in dirent_exists() as used by
vop_stdvptocnp(9), and also skipped by unionfs.

Thanks,
matthew
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to