2.2.14pre4 PATCH to fix >4GB iso9660 file systems

Adam J. Richter (adam@yggdrasil.com)
Thu, 11 Nov 1999 08:18:20 -0800


Somebody changed a bunch of variables in the iso9660 file
system code to be in terms of number of bytes instead of number of
blocks, as the variable names imply. This causes things to break
with file systems greater than 4GB, such as with a big enough
"fat iso9660" DVD-ROM. The following change restores the block number
semantics to the variable that causes the problem. Note that with this
change, disk inodes still have to be within the first 4GB, but I think
mkisofs (and every other iso9660 formatter?) spits them out first, so
this should not be a problem in practice.

Anyhow, this is a very small change. I think it makes the
code simpler. Please incorporate it.

Note: this is against a tree some other changes. If need
be, I can send you a patch against your original 2.2.14pre4.

Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."

diff -u -r /tmp/adam/checkout/linux/fs/isofs/inode.c linux/fs/isofs/inode.c
--- /tmp/adam/checkout/linux/fs/isofs/inode.c Tue Oct 19 23:24:37 1999
+++ linux/fs/isofs/inode.c Thu Nov 11 07:46:14 1999
@@ -963,7 +963,7 @@
printk("isofs_bmap: mapped inode:block %x:%d to block %lu\n",
inode->i_ino, block, (b_off - offset + firstext) >> ISOFS_BUFFER_BITS(inode));
#endif
- return (b_off - offset + firstext) >> ISOFS_BUFFER_BITS(inode);
+ return firstext + ((b_off - offset) >> ISOFS_BUFFER_BITS(inode));
}


@@ -1171,9 +1171,7 @@
iso_date(raw_inode->date, high_sierra);

inode->u.isofs_i.i_first_extent = (isonum_733 (raw_inode->extent) +
- isonum_711 (raw_inode->ext_attr_length))
- << inode -> i_sb -> u.isofs_sb.s_log_zone_size;
-
+ isonum_711 (raw_inode->ext_attr_length));
/* Initially clear this flag */
inode->u.isofs_i.i_compressed = 0;
inode->u.isofs_i.i_segoff = 0;
diff -u -r /tmp/adam/checkout/linux/fs/isofs/rock.c linux/fs/isofs/rock.c
--- /tmp/adam/checkout/linux/fs/isofs/rock.c Tue Mar 9 14:24:37 1999
+++ linux/fs/isofs/rock.c Thu Nov 11 07:48:54 1999
@@ -379,9 +379,10 @@
#ifdef DEBUG
printk("RR CL (%x)\n",inode->i_ino);
#endif
- inode->u.isofs_i.i_first_extent = isonum_733(rr->u.CL.location) <<
- inode -> i_sb -> u.isofs_sb.s_log_zone_size;
- reloc = iget(inode->i_sb, inode->u.isofs_i.i_first_extent);
+ inode->u.isofs_i.i_first_extent = isonum_733(rr->u.CL.location);
+ reloc = iget(inode->i_sb,
+ (inode->u.isofs_i.i_first_extent <<
+ inode -> i_sb -> u.isofs_sb.s_log_zone_size));
if (!reloc)
goto out;
inode->i_mode = reloc->i_mode;

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