Re: ISOFS problems

From: Roderich Schupp (rsch@ExperTeam.de)
Date: Fri Apr 21 2000 - 08:59:58 EST


Ingo Matthaes <hpsupport@grcdg364.grc.hp.com> said:
> An NFS exported CDROM (iso9660) filesystem mounted on an HPUX Client
> is invisible. Mount succeeded, but ls shows only an empty directory.
> The reason is the getattr reply. It contains a blocksize of 0 and 0
> blocks. Unfortunately the hpux nfs client code computes the buffersize
> used in the getdents() call based on these values and caused it to
> fail with EINVAL.

I ran into a similar problem when I tried to install certain
Solaris software packages from a CD that was mounted on a
Linux 2.3.99-pre5 box and NFS exported to the Solaris machine.
As in Ingo's case the culprit was that NFS getattr reports
blocksize 0 for files on the CD. I think this behaviour is fixed
for NFS v3, as fs/nfsd/nfs3xdr.c has:

encode_fattr3(struct svc_rqst *rqstp, u32 *p, struct dentry *dentry)
{
...
        if (inode->i_blksize == 0 && inode->i_blocks == 0)
                /* Minix file system(?) i_size is (hopefully) close enough */
                p = xdr_encode_hyper(p, (u64)(inode->i_size +511)& ~511);
        else
                p = xdr_encode_hyper(p, ((u64)inode->i_blocks) << 9);

BTW, inode->i_blksize == 0 does not only hold for minix fs,
but also for isofs and bfs (others?).

But for NFS v2 fs/nfsd/nfsxdr.c still has:

encode_fattr(struct svc_rqst *rqstp, u32 *p, struct inode *inode)
{
...
        *p++ = htonl((u32) inode->i_blksize);
        *p++ = htonl((u32) inode->i_rdev);
        *p++ = htonl((u32) inode->i_blocks);

Shouldn't this be changed to fake the blocksize and blocks as above
if the underlying fs doesn't provide them?

Cheers, Roderich

-- 
Even if it seems certain that you will lose, retaliate.  Neither wisdom
nor technique has a place in this. A real man does not think of victory
or defeat. He plunges recklessly towards an irrational death. By doing
this, you will awaken from your dreams. 

-- Hagakure - The Book of the Samurai

Roderich Schupp mailto:rsch@ExperTeam.de ExperTeam GmbH http://www.experteam.de/ Munich, Germany

- 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 : Sun Apr 23 2000 - 21:00:19 EST