storage_common: Support ISO files greater than 2.1GB

Muggeridge, Matt matt.muggeridge2 at hpe.com
Mon Mar 6 18:32:30 AEDT 2023


Hi,

When booting from virtual media with a Windows Installation ISO file (>8GB), I have found it fails to install due to this code in drivers/usb/gadget/function/storage_common.c<https://github.com/torvalds/linux/blob/master/drivers/usb/gadget/function/storage_common.c#:~:text=min_sectors%20%3D%201%3B-,if%20(curlun%2D%3Ecdrom)%20%7B,%7D,-if%20(num_sectors%20%3C%20min_sectors>:

        if (curlun->cdrom) {
               min_sectors = 300;     /* Smallest track is 300 frames */
               if (num_sectors >= 256*60*75) {
                       num_sectors = 256*60*75 - 1;
                       LINFO(curlun, "file too big: %s\n", filename);
                       LINFO(curlun, "using only first %d blocks\n",
                                      (int) num_sectors);
               }
        }


Removing this if-statement allows the Windows installation to proceed successfully.

It leaves me wondering that given ISO files readily exceed these limits, what is the purpose of this if-statement? What unwanted side-effects might I experience by removing this code?

FWIW, I found old references for this topic:

  *   https://lkml.org/lkml/2015/3/11/852
  *   https://lists.ozlabs.org/pipermail/openbmc/2021-June/026820.htmlOpenBMC

The discussion in the first link highlights that the limits are probably there for audio-CD (as it emulates a CD-Player). I only need this to work for data-CD. Though, if a general solution is needed, the USB Gadget driver would need to distinguish between data-CD and audio-CD.

Thanks,
Matt.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20230306/4e08540b/attachment.htm>


More information about the openbmc mailing list