Skip to contentSkip to conversation

infinite loop in generic_make_request()

bug V Ganesh 1 participant 1 message Nov 30, 2000

lore
Share & tools
lore

V Ganesh

author
#0 lore raw

[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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/