Re: [PATCH]: block: try-2 (modified): Initialize bi_rw in mpage so bio_add can make use of it.

From: Jens Axboe
Date: Mon Jul 11 2011 - 14:00:22 EST


On 2011-07-11 19:52, Muthu Kumar wrote:
>> For this particular case, doing it when the bio is allocated makes more
>> sense. That will avoid a similar error in there in the future.
>>
>
> Sounds good. Thanks. How about for other cases that alloc a new bio
> and do bio_add_page() - like blkdev_issue_zeroout() and similar.
> Should we add there too?

Good question, ideally the allocator should be passed in the rw argument
since we need it before even submitting it for the merge cases. We don't
have _that_ many callers of bio_alloc() or bio_kmalloc(), so probably
the best option is just to bite the bullet and change the prototypes to
take the 'rw' argument there. Oh, and the bioset variants, too.
bio_init() should be passed the 'rw' argument from the allcators, so we
catch any private use of that, too.

--
Jens Axboe

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