Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 157175

Summary: LVM Input/Output error during boot with recent kernel. (ALI IDE regression)
Product: [Fedora] Fedora Reporter: Martin Garton <martin>
Component: kernelAssignee: Alan Cox <alan>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: davej, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-06-06 01:56:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Martin Garton 2005-05-08 10:02:14 UTC
kernel fails to boot properly due to input/output error.

This started with kernel kernel-2.6.11-1.1282_FC4 and is still a problem with

The last working kernel for me was kernel-2.6.11-1.1276_FC4 (which I am using now)

During boot, I get the message:

Setting up Logical Volume Manager /dev/hda2: read failed after 0 of 512 at
2989876384: Input/output error

This message appears first just after the message "Reading all physical volumes.
This may take a while" and again just before the "Checking filesystems" message.

It then goes on to do a fsck (even though previously shut down cleanly.)  The
automatic fsck fails and manual fsck reports various errors before hanging
completely part way through. (I left it for over two hours)  Once hung the ide
light stays on but no disc activity seems to be going on.

Looking at possible causes, I see "Patch1710: linux-2.6.12rc-ac-ide-fixes.patch"
which looks like a possibility. However, I have not yet managed to rebuild a
kernel-2.6.11-1.1287_FC4 rpm (with or without that patch) due to build errors
that I don't yet understand.

My machine is a thinkpad r40e. hda is a "FUJITSU MHT2030AT, ATA DISK drive"

Comment 1 Martin Garton 2005-05-08 16:45:39 UTC
After overcoming my build problem I can confirm that kernel-2.6.11-1.1287_FC4
boots and works fine if I revert "Patch1710: linux-2.6.12rc-ac-ide-fixes.patch"

With help, I would be willing to help narrow this down further. Looking at the
patch I'm not sure where to start.

Additional possibly useful information snippet (from lspci):

00:0f.0 IDE interface: ALi Corporation M5229 IDE (rev c4)

Comment 2 Martin Garton 2005-05-18 09:52:31 UTC
Is anyone willing to help me nerrow down the cause of this problem? I would like
to try and fix it before FC4 final if possible.  If this is (as it seems) an ide
problem it could prevent FC4 final installing at all on some machines.

Comment 3 Martin Garton 2005-05-28 11:56:11 UTC
I can confirm this is still a problem in kernel-2.6.11-1.1363_FC4. It still
breaks my filesystem, and reverting "Patch1710:
linux-2.6.12rc-ac-ide-fixes.patch" fixes it again.

Any suggestions?

Comment 4 Alan Cox 2005-05-28 12:19:49 UTC
Thanks.  The ALi IDE controller has some serious problems with large disks. The
kernel tries to handle this and I'll go check whether I've got a mismerge
somewhere in the patch sets. What drive is attached ?

Comment 5 Alan Cox 2005-05-28 12:29:41 UTC
Hold on - 2.6.12rc IDE patches are being applied to 2.6.11 ? Thats going to be
interesting to say the least anyway.

In the 2.6.12rc case the only merge material related to the lba limit are the
following chunks. Can you drop these two chunks and see if it makes any
difference. If it does can you see which one makes the difference.

I also need to know what is logged in the kernel log on the other consoles when
it fails.

(Bugzilla will whack the formatting but they should be easy to find in the real
diff to edit)

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.
--- linux.vanilla-2.6.12rc5/drivers/ide/ide-disk.c      2005-05-27 15:37:06.000
+++ linux-2.6.12-rc5/drivers/ide/ide-disk.c     2005-05-27 15:42:21.000000000 +
@@ -475,13 +479,14 @@
 static inline void idedisk_check_hpa(ide_drive_t *drive)
-       unsigned long long capacity, set_max;
+       unsigned long long capacity, set_max = 0;
        int lba48 = idedisk_supports_lba48(drive->id);
        capacity = drive->capacity64;
        if (lba48)
                set_max = idedisk_read_native_max_address_ext(drive);
-       else
+       if (set_max == 0)       /* LBA28 or LBA48 failed */
                set_max = idedisk_read_native_max_address(drive);
        if (set_max <= capacity)
@@ -494,7 +499,8 @@
                         capacity, sectors_to_MB(capacity),
                         set_max, sectors_to_MB(set_max));
-       if (lba48)
+       /* Some maxtor support LBA48 but do not accept LBA48  set max... */
+       if (lba48 || set_max < (1ULL << 28))
                set_max = idedisk_set_max_address_ext(drive, set_max);
                set_max = idedisk_set_max_address(drive, set_max);

Comment 6 Alan Cox 2005-05-28 12:49:17 UTC
Ok not sure what the underlying trigger is but the base bug is a known 2.6.11
bug and I'm suprised it worked without that diff (though I don't know what DaveJ
has and has not applied). I can't duplicate the problem here with 2.6.12rc and
that would make sense as the underlying bug is fixed there and in

What -ac does do is get the geometry data right for large disks that have been
clipped and maybe thats what makes the difference to hitting the error case.

Anyway the fix needed is already in 2.6.12-rc* and and quoted below
(see the patch for the actual diff pieces). Applying 2.6.12rc -ac
diffs to 2.6.11 wouldn't include this fix because the 2.6.12-rc diff is against
a 2.6.12rc with the bug already fixed.

--(From message)

diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -133,6 +133,8 @@ static ide_startstop_t __ide_do_rw_disk(
        if (hwif->no_lba48_dma && lba48 && dma) {
                if (block + rq->nr_sectors > 1ULL << 28)
                        dma = 0;
+               else
+                       lba48 = 0;
        if (!dma) {
@@ -146,7 +148,7 @@ static ide_startstop_t __ide_do_rw_disk(
        /* FIXME: SELECT_MASK(drive, 0) ? */
        if (drive->select.b.lba) {
-               if (drive->addressing == 1) {
+               if (lba48) {
                        task_ioreg_t tasklets[10];
                        pr_debug("%s: LBA=0x%012llx\n", drive->name, block);

Comment 7 Martin Garton 2005-05-28 13:40:48 UTC
Thanks for the help Alan.

Your first patch does indeed give me the same problem. I am testing to see which
part of it now and will report back shortly.

Your second patch seems to not in fact be the underlying cause because it is
already included in kernel-2.6.11-1.1363_FC4 (davej has applied
patch-2.6.12-rc2.bz2 which includes it)

In case it is still useful info my drive is:
hda: FUJITSU MHT2030AT, ATA DISK drive

Comment 8 Martin Garton 2005-05-28 13:46:40 UTC
Actually, I probably don't just mean patch-2.6.12-rc2.bz2 but
patch-2.6.12-rc[12345] are included anyway and it's in there somewhere)

Comment 9 Martin Garton 2005-05-28 16:09:03 UTC
With just the first part of your first patch applied, things are fine.

With just the second part things break.

this part seems to be what is breaking it:

@@ -494,7 +499,8 @@
                         capacity, sectors_to_MB(capacity),
                         set_max, sectors_to_MB(set_max));
-       if (lba48)
+       /* Some maxtor support LBA48 but do not accept LBA48  set max... */
+       if (lba48 || set_max < (1ULL << 28))
                set_max = idedisk_set_max_address_ext(drive, set_max);
                set_max = idedisk_set_max_address(drive, set_max);

I am about to recheck my findings just to be sure.

Comment 10 Martin Garton 2005-05-28 18:53:54 UTC
I have tested this again and confirmed the same result starting from
kernel-2.6.11-1.1363_FC4 and just reverting that one line change.  It works fine.

Comment 11 Alan Cox 2005-05-29 00:11:28 UTC
Thanks thats what I was hoping after I looked at it because the if is wrong.
Please change the if to read

    if (lba48 && set_max >= (1ULL << 28))

and I think your drive will be happier


Comment 12 Martin Garton 2005-05-29 10:50:06 UTC
My drive is much happier now.

Thanks very much Alan.

Presumably this will be included in the FC packages before FC4 release? (Dave?)

Comment 13 Martin Garton 2005-06-01 15:49:24 UTC
I'm guessing this fix has missed the FC4 release now.

Is there a workaround that would allow to at least install without this fix?

Comment 14 Dave Jones 2005-06-01 21:25:07 UTC
Does booting with ide=nodma work around this ?

Comment 15 Martin Garton 2005-06-02 16:37:53 UTC
apparently not.

I didn't see the original error, but instead I got several like:

hda: task_in_intr: error=0x10 { SectorIdNotFound }, LBAsect=58604877,
ide: failed opcode was: unknown

and then I get the usual fsck and failed boot.

Comment 16 Martin Garton 2005-06-02 16:39:46 UTC
Sorry ignore that last comment.

It still does not work and the problem is the same as before with ide=nodma.

Comment 17 Martin Garton 2005-06-05 16:32:48 UTC
I spotted that this fix has been applied kernel-2.6.11-1.1369_FC4. I just want
to say thanks and confirm that it now Works For Me.

Comment 18 Dave Jones 2005-06-06 01:56:34 UTC
This got accepted for the final FC4 release kernel too, so I'll close this out.

thanks for testing.