Re: plugging in 2.4. Does it work?

Jens Axboe (axboe@suse.de)
Wed, 21 Feb 2001 18:27:43 +0100


On Wed, Feb 21 2001, Peter T. Breuer wrote:
> I'm particularly concerned about the error behaviour. How should I set
> up the end_request code in the case when the request is to be errored?
> Recall that my end_request code is presently like this:
>
> io_spin_lock
> while (end_that_request_first(req,!req->errors);
> // one more time for luck
> if (!end_that_request_first(req,!req->errors)
> end_that_request_last(req);
> io_spin_unlock
>
> and I get the impression from other driver code snippets that a single
> end_that_request_first is enough, but looking at the implementation it
> can't be. It looks from ll_rw_blk that I should walk the bh chain just
> the same in the case of error, no?

The implementation in ll_rw_blk.c (and other places) assumes that
a failed request just means the first chunk and it then makes sense
to just end i/o on that buffer and resetup the request for the next
buffer. If you want to completely scrap the request on an error, then
you'll just have to do that manually (ie loop end_that_request_first
and end_that_request_last at the end).

void my_end_request(struct request *rq, int uptodate)
{
while (end_that_request_first(rq, uptodate))
;

io_lock
end_that_request_last(rq);
io_unlock
}

And why you keep insisting on a duplicate end_that_request_first I don't
know?!

-- 
Jens Axboe

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