linux-2.3.27 patch to fix >4GB iso9660 DVD-ROM filesystems

Adam J. Richter (adam@yggdrasil.com)
Fri, 12 Nov 1999 11:58:45 -0800


Hi Linus,

This patch fixes a bug that prevents Linux from reading
>4GB iso9660 filesystems (such as "fat iso9660" DVD-ROM's).
Alan Cox has accepted my corresponding patch against 2.2.14pre4.

Here is the detailed explanation, for your information:

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.

I tested an ~8GB iso9660 filesystem that was having these
problems and these changes made the problem go away. I have done
these tests on both 2.2.14pre4 and 2.3.27 (the patch that I am
sending you is for 2.3.27).

Anyhow, this is a very small change. I think it makes the
code simpler. Please incorporate it, so that Linux users can have
>4GB iso9660 DVD-ROM's. Thanks!

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 linux-2.3.27/fs/isofs/inode.c linux/fs/isofs/inode.c
--- linux-2.3.27/fs/isofs/inode.c Thu Nov 4 15:50:50 1999
+++ linux/fs/isofs/inode.c Fri Nov 12 11:38:45 1999
@@ -990,8 +999,8 @@
}

bh_result->b_dev = inode->i_dev;
- bh_result->b_blocknr =
- (b_off - offset + firstext) >> ISOFS_BUFFER_BITS(inode);
+ bh_result->b_blocknr = firstext +
+ ((b_off - offset) >> ISOFS_BUFFER_BITS(inode));
bh_result->b_state |= (1UL << BH_Mapped);
err = 0;

@@ -1236,8 +1245,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));

/* Now test for possible Rock Ridge extensions which will override some of
these numbers in the inode structure. */
diff -u -r linux-2.3.27/fs/isofs/rock.c linux/fs/isofs/rock.c
--- linux-2.3.27/fs/isofs/rock.c Fri Sep 25 16:27:13 1998
+++ linux/fs/isofs/rock.c Fri Nov 12 11:38:45 1999
@@ -358,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/