Re: NFSv3 pathname problems in 2.4 kernels

Neil Brown (neilb@cse.unsw.edu.au)
Tue, 24 Jul 2001 09:38:37 +1000 (EST)


On Monday July 23, gmlack@freenet.co.uk wrote:
> Neil Brown wrote:
> >
> > This shouldn't be a problem for Solaris 2.6, but definately is for
> > Irix.
>
> Well, there are many 2.6 systems and they all fail in the same aay
> as Irix. So does Solaris 2.7. (2.8 seems to be Ok).

Odd indeed. I use 2.6 systems and they seem fine. I have only had
the problem when using an old version of mountd. What verion of
nfs-utils are you using?

> > Look in fs/nfsd/nfsfh.c, in fh_compose.
> > If you change:
> > if (ref_fh &&
> > ref_fh->fh_handle.fh_version == 0xca &&
> > parent->d_inode->i_sb->s_op->dentry_to_fh == NULL) {
> > to
> > if (parent->d_inode->i_sb->s_op->dentry_to_fh == NULL) {
> > you will probably get what you want, for ext2 at least.
>
> Thanks, but this is for xfs (I didn't fancy fsck'ing a 470GB file
> system!). I suppose it's suck it and see....

It should work for xfs, and infact everything but reiserfs as it is
the only filesys that currently sets dentry_to_fh.
However a better, more general solution would be to add a line:

if (fhp->fh_handle.fh_size < NFS_FHSIZE)
fhp->fh_handle.fh_size = NFS_FHSIZE;

just before the "return 0" in fh_update, and

if (inode && fhp->fh_handle.fh_size < NFS_FHSIZE)
fhp->fh_handle.fh_size = NFS_FHSIZE;

before the "return 0" in fh_compose.

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