2000-11-30 07:35:11

by V Ganesh

[permalink] [raw]
Subject: [bug] infinite loop in generic_make_request()

[cc'ed to maintainers of md and lvm]

hi,
in generic_make_request(), the following code handles stacking:

do {
q = blk_get_queue(bh->b_rdev);
if (!q) {
printk(...)
buffer_IO_error(bh);
break;
}
} while (q->make_request_fn(q, rw, bh));

however, make_request_fn may return -1 in case of errors. one such fn is
raid0_make_request(). this causes generic_make_request() to loop endlessly.
lvm returns 1 unconditionally, so it would also loop if an error occured in
lvm_map(). other bdevs might have the same problem.
I think a better mechanism would be to mandate that make_request_fn ought
to call bh->b_end_io() in case of errors and return 0.

ganesh