--- tmp/drivers/block/ll_rw_blk.c.~1~ Mon Aug 9 00:49:51 1999 +++ tmp/drivers/block/ll_rw_blk.c Mon Aug 9 00:54:30 1999 @@ -565,7 +565,7 @@ /* if no request available: if rw_ahead, forget it; otherwise try again blocking.. */ if (!req) { if (rw_ahead) - goto end_io; + goto failed_ahead; req = __get_request_wait(max_req, bh->b_rdev); } @@ -583,6 +583,16 @@ add_request(major+blk_dev,req); return; +failed_ahead: + switch (rw) + { + case WRITE: + /* nobody can write to a buffer while it's locked */ + if (test_and_set_bit(BH_Dirty, &bh->b_state)) + BUG(); + refile_buffer(bh); + break; + } end_io: bh->b_end_io(bh, test_bit(BH_Uptodate, &bh->b_state)); }