Skip to contentSkip to conversation

hfs cdrom broken in 2.4.13pre

DISCUSSION Giuliano Pochini 10 participants 19 messages Oct 22, 2001 – Oct 24, 2001

lore
Share & tools
lore
#0 lore raw

Kernel 2.4.13pre1 on powerpc. I can no longer mount HFS-formatted cdroms. The last kernel I'm sure it worked fine is 2.4.7

Oct 20 23:58:51 Jay kernel: ll_rw_block: device 0b:00: only 2048-char blocks
implemented (512) 
Oct 20 23:58:51 Jay kernel: hfs_fs: unable to read block 0x00000002 from dev
0b:00 
Oct 20 23:58:51 Jay kernel: hfs_fs: Unable to read superblock 
Oct 20 23:58:51 Jay kernel: ll_rw_block: device 0b:00: only 2048-char blocks
implemented (512) 
Oct 20 23:58:51 Jay kernel: hfs_fs: unable to read block 0x00000000 from dev
0b:00 
Oct 20 23:58:51 Jay kernel: hfs_fs: Unable to read block 0. 

Bye.

#1 lore raw
Quoted 2 lines

Kernel 2.4.13pre1 on powerpc. I can no longer mount HFS-formatted cdroms. The last kernel I'm sure it worked fine is 2.4.7

Mount it over loopback device. We at some point need to make that bit transparent.

#2 lore raw
Quoted 5 lines · on 22/10/01 4:44 PM, Alan Cox at [email protected] wrote:
Quoted 3 lines

Kernel 2.4.13pre1 on powerpc. I can no longer mount HFS-formatted cdroms. The last kernel I'm sure it worked fine is 2.4.7

Mount it over loopback device.

Why has that become necessary?

-Hollis

#3 lore raw
Quoted 8 lines
Quoted 5 lines · on 22/10/01 4:44 PM, Alan Cox at [email protected] wrote:
Quoted 3 lines

Kernel 2.4.13pre1 on powerpc. I can no longer mount HFS-formatted cdroms. The last kernel I'm sure it worked fine is 2.4.7

Mount it over loopback device.

Why has that become necessary?

Primarily because the glue in the middle isnt covering up for your CD-ROM any more.

Alan

#4 lore raw
In reply to Hollis Blanchard
Quoted 6 lines · Alan Cox
Quoted 6 lines
Quoted 4 lines · on 22/10/01 4:44 PM, Alan Cox at [email protected] wrote:
Quoted 3 lines

Kernel 2.4.13pre1 on powerpc. I can no longer mount HFS-formatted cdroms. The last kernel I'm sure it worked fine is 2.4.7

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Mount it over loopback device.

Why has that become necessary?

Primarily because the glue in the middle isnt covering up for your CD-ROM any more.

No, really. What's changed to break HFS cdrom support?

Signature · 2 lines
Tom Rini (TR1265)
http://gate.crashing.org/~trini/
#5 lore raw
Quoted 1 line · Tom Rini

No, really. What's changed to break HFS cdrom support?

Based on the messages and glancing over the hfs code, I would guess that the CD-ROM block device driver used to fake accessing the drive at any random block size. The hfs code depends on being able to use a particular block size (512) and if the driver for the block device doesn't support it, stuff breaks.

(super.c lines 394-416/491 byte 10778/12361 87%)

        /* set the device driver to 512-byte blocks */
        set_blocksize(dev, HFS_SECTOR_SIZE);

To be more flexible, the hfs code shouldn't force a hard coded block size.

Brad Boyer
[email protected]

#6 lore raw
In reply to Tom Rini
Quoted 11 lines
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

The last kernel I'm sure it worked fine is 2.4.7

Mount it over loopback device.

Why has that become necessary?

Primarily because the glue in the middle isnt covering up for your CD-ROM any more.

No, really. What's changed to break HFS cdrom support?

The cdcom code no longer permitting to fake a nonstandard block size? The blocksize on CDs is always 2k IIRC, the HFS driver just can't cope with that.

Besides - hasn't HFS CDROM support been broken since a long time? Or was that HFS? :-)

Michael

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#7 lore raw
Quoted 2 lines · Michael Schmitz

Besides - hasn't HFS CDROM support been broken since a long time? Or was that HFS? :-)

There was a slightly more informed discussion about this in August 2000 on the linux-kernel list. The bug was found in the scsi code and fixed shortly afterwards by Jens Axboe, IIRC. This was in the good old days when people thought the upcoming 2.4 kernel series would be stable and bleeding-edge development would happen in a 2.5 series.

--
Martin

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#8 lore raw
Quoted 5 lines
Quoted 3 lines

Besides - hasn't HFS CDROM support been broken since a long time? Or was that HFS? :-)

There was a slightly more informed discussion about this in August 2000

One would hope so. All I remember about CDROMs is they use a different blocksize which causes all sorts of funny side effects in generic code that assumes the only sane blocksize is 512. Not having read l-k since '98 I missed that.

Quoted 2 lines

on the linux-kernel list. The bug was found in the scsi code and fixed shortly afterwards by Jens Axboe, IIRC. This was in the good old days

So mounting HFS CDROMs no longer panics? But there's been other reports of HFS bugs I think. HFS could use a larger overhaul, that might make integrating HFS+ easier and either do away with the 512 byte blocksize assumption or hide the conversion inside the HFS driver.
I know nothing about filesystems in general, much less HFS. If there was another informed discussion on l-k on this topic I'd be happy to know.

Quoted 2 lines

when people thought the upcoming 2.4 kernel series would be stable and bleeding-edge development would happen in a 2.5 series.

Ouch.

Michael

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#9 lore raw
Quoted 4 lines

One would hope so. All I remember about CDROMs is they use a different blocksize which causes all sorts of funny side effects in generic code that assumes the only sane blocksize is 512.

No. The point is that filesystems should not make assumptions about hardware block size (except it being power of 2 I believe). If there was code in block layer to provide broken FS's compatibility and that code has been removed, then we must fix the FS. Who's HFS maintainer ?

Quoted 1 line

So mounting HFS CDROMs no longer panics ?

They always worked fine for me.

Bye.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#10 lore raw
Quoted 9 lines
Quoted 4 lines

One would hope so. All I remember about CDROMs is they use a different blocksize which causes all sorts of funny side effects in generic code that assumes the only sane blocksize is 512.

No. The point is that filesystems should not make assumptions about hardware block size (except it being power of 2 I believe). If there was code in block layer to provide broken FS's compatibility and that code has been removed, then we must fix the FS. Who's HFS maintainer ?

The hardware block size is 2048. The logical block size of the file system is 512 bytes, Someone has to do reblocking. So the choices are

1; We hack crap into the file systems
2: We hack crap into the drivers
3: We listen to Al Viro

#3 (using the loopback device) solves everything nicely - it just needs to be implied automatically

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#11 lore raw
In reply to Giuliano Pochini
Quoted 9 lines
Quoted 4 lines

One would hope so. All I remember about CDROMs is they use a different blocksize which causes all sorts of funny side effects in generic code that assumes the only sane blocksize is 512.

No. The point is that filesystems should not make assumptions about hardware block size (except it being power of 2 I believe). If there was code in block layer to provide broken FS's compatibility and that code has been removed, then we must fix the FS. Who's HFS maintainer ?

Orphaned I think. But I agree it should be fixed. Using loopback on the sly doesn't sound a lot cleaner than a reblocking hack in the HFS driver :-)

Michael

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#12 lore raw
Quoted 7 lines
Quoted 3 lines

was code in block layer to provide broken FS's compatibility and that code has been removed, then we must fix the FS. Who's HFS maintainer ?

Orphaned I think. But I agree it should be fixed. Using loopback on the sly doesn't sound a lot cleaner than a reblocking hack in the HFS driver :-)

Believe me it is a lot lot cleaner. It isnt just HFS, its almost all file systems. If you add a generic reblocking layer it ends up looking remarkably like the loopback driver

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#13 lore raw
Quoted 8 lines
Quoted 4 lines

Orphaned I think. But I agree it should be fixed. Using loopback on the sly doesn't sound a lot cleaner than a reblocking hack in the HFS driver :-)

Believe me it is a lot lot cleaner. It isnt just HFS, its almost all file systems. If you add a generic reblocking layer it ends up looking remarkably like the loopback driver

'almost all file systems' means with respect to CDROM, or in general? I can't quite believe something is so fundamentally wrong to affect all filesystems...

By 'it should be fixed' I meant the HFS driver should be fixed to not assume a fixed blocksize.

Michael

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#14 lore raw
Quoted 7 lines

'almost all file systems' means with respect to CDROM, or in general? I can't quite believe something is so fundamentally wrong to affect all filesystems...

By 'it should be fixed' I meant the HFS driver should be fixed to not assume a fixed blocksize.

The block size of the file system is 512 bytes. The block size of the media is 2048 bytes. Two totally seperate things

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#18 lore raw
In reply to Giuliano Pochini
Quoted 6 lines
Quoted 5 lines

One would hope so. All I remember about CDROMs is they use a different blocksize which causes all sorts of funny side effects in generic code that assumes the only sane blocksize is 512.

Quoted 8 lines

No. The point is that filesystems should not make assumptions about hardware block size (except it being power of 2 I believe). If there was code in block layer to provide broken FS's compatibility and that code has been removed, then we must fix the FS. Who's HFS maintainer ?

Quoted 1 line

So mounting HFS CDROMs no longer panics ?

They always worked fine for me.

I don't know if there's still an active HFS maintainer. That is not the only bugs in HFS. Locking is broken and HFS can easily deadlock on an SMP box. I've been reported disk corruption with it, and experienced corrupted file when written from linux occasionally, I suspect something must be wrong with btree rebalancing.

I have done some work on locking (replacing most broken spinlocks with semaphores) but never really finished it. Most people rely on HFS tools, not on the HFS fs. I don't have the time to work more seriously on it, but it would be an interesting project for someone motivated, especially since you now have Apple's implementation to use as a reference ;)

Ben.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#15 lore raw
In reply to Alan Cox
Quoted 6 lines
Quoted 3 lines

By 'it should be fixed' I meant the HFS driver should be fixed to not assume a fixed blocksize.

The block size of the file system is 512 bytes. The block size of the media is 2048 bytes. Two totally seperate things

Color me confused... It's clear now, thanks for your patience. Shutting up, hunting for brown paper bag...

One final concern: your solution means we need (most of) loopback in the kernel at all times, right? Makes it impossibe to build a kernel without loopback, or with loopback as a module? Am I missing something still?

Michael

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#16 lore raw
Quoted 3 lines

kernel at all times, right? Makes it impossibe to build a kernel without loopback, or with loopback as a module? Am I missing something still?

You would need loopback in kernel or as a module. That isnt a big problem in the sense that its no bigger than internal glue to do the job and in fact is pretty small anyway (about 8K)

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#17 lore raw
Quoted 5 lines
Quoted 3 lines

kernel at all times, right? Makes it impossibe to build a kernel without loopback, or with loopback as a module? Am I missing something still?

You would need loopback in kernel or as a module. That isnt a big problem

And whatever your root filesystem, it better not rely on loopback for any blocksize mangling. That's what I'm queasy about, mostly (plus the option to build kernels without any loopback support, in case anyone wants that).

I'm sure that's been hashed out in excruciating detail, and someone's thought of it.

Michael

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/