Re: All the problems with 2.2.8/2.3.x and bdflush/update

Andrea Arcangeli (andrea@suse.de)
Mon, 17 May 1999 03:19:16 +0200 (CEST)


On Fri, 14 May 1999, Zack Weinberg wrote:

>You may be right. There's a huge race in wakeup_bdflush. If asked to
>wait, it calls run_task_queue(&tq_disk) after waking bdflush but
>BEFORE sleeping on bdflush_done. That's been there for a really long
>time, I guess it is easier to trigger with my changes applied.

You are completly right about this. This is a completly untested fix alone
against 2.2.9 (my buffer code fixed this too but only incidentally, and
that's why I didn't thought too much about your words above until now).

--- linux/fs/buffer.c Fri May 14 20:22:39 1999
+++ linux/fs/buffer.c Mon May 17 03:04:51 1999
@@ -1561,11 +1561,11 @@
{
if (current == bdflush_tsk)
return;
- wake_up(&bdflush_wait);
- if (wait) {
+ if (wait)
run_task_queue(&tq_disk);
+ wake_up(&bdflush_wait);
+ if (wait)
sleep_on(&bdflush_done);
- }
}


Andrea Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/