Re: [NFS] Patch for problems with cdrom exported via NFS

From: willy@thepuffingroup.com
Date: Thu Jun 01 2000 - 15:11:39 EST


On Thu, Jun 01, 2000 at 07:08:41PM +0200, Roderich Schupp wrote:
> The reason is that isofs in Linux has i_blksize=0 and i_blocks=0 in
> the inode. For a NFS gettattr call we blindly copy these values into
> the fsattr structure. The fix is to set these to a sane value. A
> similar fix exists in the NFSv3 server code. Patch against 2.4.0-test1
> below.

Um. Surely we should fix isofs instead? Here's a quicky (uncompiled,
untested, copy-and-pasted so lost tabs):

--- inode.c Mon May 8 14:11:29 2000
+++ inode.new Thu Jun 1 15:10:33 2000
@@ -1145,8 +1145,6 @@
        }
        inode->i_uid = inode->i_sb->u.isofs_sb.s_uid;
        inode->i_gid = inode->i_sb->u.isofs_sb.s_gid;
- inode->i_blocks = inode->i_blksize = 0;
-
 
        inode->u.isofs_i.i_section_size = isonum_733 (raw_inode->size);
        if(raw_inode->flags[-high_sierra] & 0x80) {
@@ -1178,6 +1176,9 @@
                printk("Interleaved files not (yet) supported.\n");
                inode->i_size = 0;
        }
+
+ inode->i_blksize = 512;
+ inode->i_blocks = (inode->i_size + 511) >> 9;
 
        /* I have no idea what file_unit_size is used for, so
           we will flag it for now */

-- 
The Sex Pistols were revolutionaries.  The Bay City Rollers weren't.

- 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 : Wed Jun 07 2000 - 21:00:13 EST