Commit 7e8745b8 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] ide: fix bad disk geometry hang

From: Alan Cox <alan@redhat.com>

If you get invalid geometry (eg a failed drive) the box hangs on boot because
we try and unregister the registered driver and end up in a locking mess.

We change the behaviour to simply leave the device unattached which avoids
the mess.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent db73f734
......@@ -1809,11 +1809,9 @@ static int idedisk_attach(ide_drive_t *drive)
if ((!drive->head || drive->head > 16) && !drive->select.b.lba) {
printk(KERN_ERR "%s: INVALID GEOMETRY: %d PHYSICAL HEADS?\n",
drive->name, drive->head);
ide_cacheflush_p(drive);
ide_unregister_subdriver(drive);
DRIVER(drive)->busy--;
goto failed;
}
drive->attach = 0;
} else
drive->attach = 1;
DRIVER(drive)->busy--;
g->minors = 1 << PARTN_BITS;
strcpy(g->devfs_name, drive->devfs_name);
......@@ -1821,7 +1819,6 @@ static int idedisk_attach(ide_drive_t *drive)
g->flags = drive->removable ? GENHD_FL_REMOVABLE : 0;
set_capacity(g, current_capacity(drive));
g->fops = &idedisk_ops;
drive->attach = 1;
add_disk(g);
return 0;
failed:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment