Re: 'bad: scheduling while atomic!', preempt kernel, 2.6.1-test11,reading an apparently duff DVD-R
From: Linus Torvalds
Date: Mon Dec 15 2003 - 10:21:35 EST
On Mon, 15 Dec 2003, Toad wrote:
>
> I got the following when trying to mount a particular DVD-R on Linux
> 2.6.0-test11, using an IDE DVD-RW drive, using SCSI emulation, with the
> preempt kernel option enabled, and taskfile I/O:
> (the middle bit was repeated several times):
ide-scsi does
spin_lock_irqsave(&ide_lock, flags);
while (HWGROUP(drive)->handler) {
HWGROUP(drive)->handler = NULL;
schedule_timeout(1);
}
which is obvious crap. Scheduling while holding a spinlock is not a good
idea.
You could try dropping the lock over the schedule and re-aquire it
afterwards, but the comment tries to say that it is required for avoiding
new requests.
This is why ide-scsi needs a maintainer, btw - somebody who cares about
it, and actually tries to resolve the current mess.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/