Kernel uncorrectly forces cruft option when some options of mkisofs are used

Kernel uncorrectly forces cruft option when some options of mkisofs are used

Post by Guillermo S. Romero / Familia Romer » Sat, 16 Feb 2002 07:10:08



[Please CC the replies, I am not subscribed to lkml, thanks.]

Hi:

I have been using some options in mkisofs to group CD images (-volset
"string" -volset-size N -volset-seqno n). I read the man page and
thought they where a good idea to store the relation among CDs. I also
read the following docs (to check other docs, just in case):
http://www.y-adagio.com/public/standards/iso_cdromr/tocont.htm
ftp://ftp.ecma.ch/ecma-st/Ecma-119.pdf

Now the fun, when I mount a CD with seqno above 1 (this one had number
3 recorded... it is the third of a group of 3, I had to store over
1.5GB in one row), I get in the logs something like:

kernel: Warning: defective CD-ROM (volume sequence number 3). Enabling
"cruft" mount option.

I am currently using RH71, mkisofs is 1.13 (i686-pc-linux-gnu) and
kernel is 2.4.2-2. I scanned the Linux src I have and found in
fs/isofs/inode.c around line 1251:

        /*
         * Disable checking if we see any volume number other than 0 or 1.
         * We could use the cruft option, but that has multiple purposes, one
         * of which is limiting the file size to 16Mb.  Thus we silently allow
         * volume numbers of 0 to go through without complaining.
         */
        if (inode->i_sb->u.isofs_sb.s_cruft == 'n' &&
            (volume_seq_no != 0) && (volume_seq_no != 1)) {
                printk(KERN_WARNING "Warning: defective CD-ROM "
                       "(volume sequence number %d). "
                       "Enabling \"cruft\" mount option.\n", volume_seq_no);
                inode->i_sb->u.isofs_sb.s_cruft = 'y';

In 2.4.17 the line is 1286, but the situation is the same, if sequence
number not 0 or 1, cruft. Some other things are fixed, like ISO images
of 2GB (my 2.4.2 allows 1GB, and some older version I found while
investigating, a magic 800MB) so I believe that the file is a nest of
unsupported (by docs or good reasoning) decissions, being seqno
another example that has to be fixed, like the 2GB one was.

cruft option is described in include/linux/iso_fs_sb.h as "Broken
disks with high byte of length containing junk", not a magical
solution for everything. And that description is wrong as the comment
in 2.4.17 demostrates, size is a 32 bit number thus size can be 2GB
like other 32 bit based systems. The PDF in pages 3 and 8 describes
volume sets (it is not multisession, it is just about tags in the
header so machines "get eyes and can read the feltmarker").

Proposed solutions:

- remove the test in inode.c, it is wrong by spec. cdrecord package
coder J?rg Schilling thinks the same when I asked. See thread in

- add http://www.y-adagio.com/public/standards/iso_cdromr/tocont.htm
and specially ftp://ftp.ecma.ch/ecma-st/Ecma-119.pdf to the
documentation file.

- review all the isofs files with the spec on the side and make sure
they are right. The IGNORE_WRONG_MULTI_VOLUME_SPECS define looks wrong
to me and makes me think, multi volume is hint info for applications,
not a hard requirement, and has nothing to do with multisession or
similar things. It is like volume ID (used by Windows and Mac for the
icon, they could also use something like "volsetid - seqno/setsize"),
the files are fine whatever these header fields have. So I guess
someone read the wrong specs (the comment above the define does not
match, it says something about no support for multi volume... again
madness).

Patch against a clean 2.4.17 for document and inode.c follow. I made
it with "diff -uraN linux-2.4.17.orig linux". Third thing... well, I
am trying to understand the rest of the file, I am completly new to
this, if I manage to get something that works I will post it.

Documentation:
---8<---
--- linux-2.4.17.orig/Documentation/filesystems/isofs.txt       Wed May 26 19:01:43 1999

   unhide        Show hidden files.
   session=x     Select number of session on multisession CD
   sbsector=xxx  Session begins from sector xxx
+
+Recommended documents about ISO 9660 standard are located at:
+http://www.y-adagio.com/public/standards/iso_cdromr/tocont.htm
+ftp://ftp.ecma.ch/ecma-st/Ecma-119.pdf
--->8---

inode.c
---8<---
--- linux-2.4.17.orig/fs/isofs/inode.c  Thu Oct 25 22:53:53 2001

        /* get the volume sequence number */
        volume_seq_no = isonum_723 (de->volume_sequence_number) ;

-       /*
-        * Disable checking if we see any volume number other than 0 or 1.
-        * We could use the cruft option, but that has multiple purposes, one
-        * of which is limiting the file size to 16Mb.  Thus we silently allow
-        * volume numbers of 0 to go through without complaining.
-        */
-       if (inode->i_sb->u.isofs_sb.s_cruft == 'n' &&
-           (volume_seq_no != 0) && (volume_seq_no != 1)) {
-               printk(KERN_WARNING "Warning: defective CD-ROM "
-                      "(volume sequence number %d). "
-                      "Enabling \"cruft\" mount option.\n", volume_seq_no);
-               inode->i_sb->u.isofs_sb.s_cruft = 'y';
-       }
-
        /* Install the inode operations vector */
 #ifndef IGNORE_WRONG_MULTI_VOLUME_SPECS
        if (inode->i_sb->u.isofs_sb.s_cruft != 'y' &&
--->8---

GSR

PS: Remember to CC me, thanks.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. Using the -i option of mkisofs

        I can't seem to get the -i option of mkisofs to work fo me -- does
anybody have an example I could look at?

        What I'm trying to do is generate an iso9660 output file incorporating
the files from paths

        Path on hard disk                           Path on CD-ROM
        /var/mirror/redhat/redhat-4.1/i386/         as /
        /usr/doc/RFC                                as /stuff/RFC
        /var/mirror/redhat/redhat-4.1/updates/i386/ as /stuff/updates

I don't have the disk space for an extra copy of this :-)
I'm using mkisofs-1.10b2.
TIA.    
--
James Youngman       VG Gas Analysis Systems  The trouble with the rat-race
Before sending advertising material, read     is, even if you win, you're
http://www.law.cornell.edu/uscode/47/227.html         still a rat.

2. Starting more than one X server

3. Using options BRIDGE and options IPFIREWALL together?

4. Upper case in ftp

5. kernel options - how do i know what options were compiled on install

6. boot-device problem

7. iso9660 and cruft option

8. fcntl (F_DUPFD) - what does "next available decriptor" mean?

9. isofs: cruft option with volume_seq_no? (patch included)

10. in cdrtools 2.0, mkisofs 2.0 no longer has option -jext?

11. howto use mkisofs -eltorito-alt-boot option

12. cdrecord and mkisofs best options