Re: patch for allowing msdos/vfat nfs exports

From: Linus Torvalds (
Date: Tue Jul 24 2001 - 11:37:39 EST

On Mon, 23 Jul 2001, Alexander Viro wrote:
> On Mon, 23 Jul 2001, Nathan Laredo wrote:
> > + result = d_alloc_root(inode);
> > + if (result == NULL) {
> > + iput(inode);
> > + return ERR_PTR(-ENOMEM);
> > + }
> > + result->d_flags |= DCACHE_NFSD_DISCONNECTED;
> > + return result;
> Erm... AFAICS it got a race - think of doing that for directory when
> dentry is already gone, but inode still in cache. You will get
> nfsd_findparent() called and that will give funny results on FAT.

Note that the code was definitely cribbed from reiserfs, and when I stole
it I had this very strong feeling that "This really should be supported in
the VFS layer instead of hidden in the low-level filesystems".

We are, after all, working with very internal knowledge of not only the
way the dentry lists are attached to the inode, but also about the whole

> The worst thing being, it _will_ get a decently-looking inode. Inode that
> will point to the same blocks as parent directory, but will be completely
> independent (different location).

Absolutely. And some of the NFS-export problems won't even be avoidable at
all: FAT does not have a notion of inode versions etc, and we do not have
a way to fix that.

However, what we could do is add more sanity-testing, and for example also
add the parent inode location to the dentry_to_fh code. We have space.

The patch was a fairly quick hack. What it does show is that (a) the
dentry_to_fh approach is actually a very usable one in itself and wasn't
just an ugly reiserfs hack, and (b) FAT _can_ be exported.

The reason I asked Nathan to post the damn thing instead of just applying
it to the tree was to get these kinds of comments, and hopefully move the
VFS stuff to a VFS location, ie start exporting a vfs_inode_to_dentry()
function that reiserfs, FAT and quite possibly others can sanely share.

Al, Neil, care to work something out between you? I saw that Neil had
something already..


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 21:00:16 EST