lkml.org 
[lkml]   [1999]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ext2 warning in Linux 2.2.7


On Tue, 4 May 1999, H.J. Lu wrote:

> > > The problem is knsfd 1.2.2a. It calls iget to find the inode and
> > > then calls iput to release it. If the inode requested from the
> > > client has been deleted on the server and iget happened to get
> > > the deleted inode from the disk, iput on the deleted inode will
> > > cause the prolem. One solutaion is to make a new function,
> > > iget_in_use, which will only return the inode if it is in use.
> > > I will make knsfd 1.3 soon to fix the bug.
> >
> > ;-/ I'm afraid that the whole scheme with calling iget() here is broken by
> > design. You can get out with this kludge in case of ext2, but for
> > NFS/NCPFS/SMBFS/CODA reexports, for anything FAT-derived, for ISOFS... Not
> > going to work. And even in case of ext2/ufs/sysvfs/minix it's a kludge.
> >
> > I've played with that place of knfsd last two weeks and I have to agree
> > with Linus - iget() should be used only inside of UNIX-like filesystems
> > and only for regular lookups. Maybe we should give up on using inumber
> > here (we are using pair of inumbers anyway) and leave the decision re what
> > is proper fhandle to filesystem drivers. That would mean adding
> > dentry_to_fh and fh_to_dentry methods and dropping the corresponding code
> > from knfsd. If filesystem doesn't implement them - though luck, stale
> > dentry => stale fhandle. We can't do any better for ISOFS and friends
> > anyway.
>
> The NFS protocal may be broken. But Linux has to work with as many
> NFS client implementations as possible. That means there should be
> no dentry, or anything like pointers to memory or filenames, in
> filehandle. filehandle shouldn't change because of reboot, rename
> nor hardlink. If we cannot get them all, at least we should try.
> Otherwise, we just call it LNFS and tell everyone it is not
> interoperatable with most NFS client implementations.

That's fine, but there is one huge but. First of all, with many
filesystems you simply *don't have* an invariant that would be preserved
across umount;mount, let along reboot and would fit into 64 bits.
For FAT-derived filesystems you don't have an invariant that would survive
_both_ remount and rename. There is nothing to do about that and no OS can
help here. Period.

What I am talking about is that we have different requirements for i_ino
lifetime and fhandle one. The method currently used by knfsd more or less
works with ext2 and other UNIX filesystems. For the rest it simply breaks.

I think that we should put the fhandle<->VFS object translation into
individual filesystems. For normal filesystems it would mean moving the
current knfsd code into VFS, exporting it and letting new methods call it.
Other filesystems may implement more appropriate versions themselves.

Do you have any objections against that? Notice that current code simply
doesn't work for non-UNIX filesystems (and maybe HPFS & NTFS).


-
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/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.144 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site