[plug] iso9660 and 2GB filesize limit

Cameron Patrick cameron at patrick.wattle.id.au
Tue Jul 20 18:42:09 WST 2004


William Kenworthy wrote:

> I would like to know this myself.  I had a dvd burnt (on a mac) of some
> backups, but linux refused to read it properly.  Eventually gave up in
> disgust without finding a way around it.

Looking at fs/isofs/inode.c, there is this comment:

        /*
         * The ISO-9660 filesystem only stores 32 bits for file size.
         * mkisofs handles files up to 2GB-2 = 2147483646 = 0x7FFFFFFE bytes
         * in size. This is according to the large file summit paper from 1996.
         * WARNING: ISO-9660 filesystems > 1 GB and even > 2 GB are fully
         *          legal. Do not prevent to use DVD's schilling at fokus.gmd.de
         */
[...]
                printk(KERN_WARNING "Warning: defective CD-ROM.  "
                       "Enabling \"cruft\" mount option.\n");
[...]
        /*
         * Some dipshit decided to store some other bit of information
         * in the high byte of the file length.  Catch this and holler.
         * WARNING: this will make it impossible for a file to be > 16MB
         * on the CDROM.
         */

If you see that "defective CD-ROM" message in syslog, then I'd guess
that the attached patch (written by me, utterly untested, use at your
own risk) may fix it.  Googling reveals some postings on the cdrecord
list from a year ago which suggest that ISO Level 3 (required for
large files) isn't properly supported under Linux, though, so it may
just make things worse.  There is however a function that claims to
implement it, isofs_read_level3_size, also in isofs/inode.c.

Cameron.

diff -ru kernel-source-2.6.7.orig/fs/isofs/inode.c kernel-source-2.6.7/fs/isofs/inode.c
--- kernel-source-2.6.7.orig/fs/isofs/inode.c   2004-07-08 14:08:13.000000000 +0800
+++ kernel-source-2.6.7/fs/isofs/inode.c        2004-07-20 18:39:56.000000000 +0800
@@ -1276,23 +1276,10 @@
         */
        if ((inode->i_size < 0 || inode->i_size > 0x7FFFFFFE) &&
            sbi->s_cruft == 'n') {
-               printk(KERN_WARNING "Warning: defective CD-ROM.  "
-                      "Enabling \"cruft\" mount option.\n");
+               printk(KERN_WARNING "Warning: using Cameron's dodgy hack to disable checks on file size");
                sbi->s_cruft = 'y';
        }
 
-       /*
-        * Some dipshit decided to store some other bit of information
-        * in the high byte of the file length.  Catch this and holler.
-        * WARNING: this will make it impossible for a file to be > 16MB
-        * on the CDROM.
-        */
-
-       if (sbi->s_cruft == 'y' &&
-           inode->i_size & 0xff000000) {
-               inode->i_size &= 0x00ffffff;
-       }
-
        if (de->interleave[0]) {
                printk("Interleaved files not (yet) supported.\n");
                inode->i_size = 0;





More information about the plug mailing list