Re: [NFS] bad inode number: 0 and NFS

From: Neil Brown (neilb@cse.unsw.edu.au)
Date: Mon Mar 06 2000 - 19:16:36 EST


On Monday March 6, hjl@valinux.com wrote:
> I am looking at the "bad inode number: 0" problem. I am somewhat
> puzzled by the following code from lookup_inode () in fs/nfsd/nfsfh.c:
>
> if (dirino == root_ino) {
> dentry = dget(root);
> }
> else {
> result = ERR_PTR(-ENOENT);
> dir = iget_in_use(sb, dirino);
> if (!dir)
> goto out_root;
> dentry = d_alloc_root(dir, NULL);
> if (!dentry)
> goto out_iput;
> }
>
> /*
> * Get the name for this inode and the next parent inode.
> */
> dirent.ino = ino;
> error = get_parent_ino(dentry, &dirent);
> result = ERR_PTR(error);
> dput(dentry);
>
> If I am right, it calls d_alloc_root () with some non-root inode
> to create a temporary dentry. Will that cause problem since that
> dentry will map "/" to the inode which is not the root inode?

This code has been totally re-written in 2.3 and in the patches that
Dave Higgens in maintaining for 2.2.14.

However, the dentry returned by d_alloc_root() here is never inserted
into the dcache tree and so can never map anything to anything. It
gets totally discarded when dput is called on it.

NeilBrown

>
>
>
> --
> H.J. Lu (hjl@gnu.org)
>
> _______________________________________________
> NFS maillist - NFS@lists.sourceforge.net
> http://lists.sourceforge.net/mailman/listinfo/nfs

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:21 EST