Re: [RFC PATCH] blk: reset 'bi_next' when bio is done inside request

2017-04-04 Thread NeilBrown
On Tue, Apr 04 2017, Michael Wang wrote: > On 04/04/2017 11:37 AM, NeilBrown wrote: >> On Tue, Apr 04 2017, Michael Wang wrote: > [snip] If sync_request_write() is using a bio that has already been used, it should call bio_reset() and fill in the details again. However I don't

Re: [RFC PATCH] blk: reset 'bi_next' when bio is done inside request

2017-04-04 Thread Michael Wang
On 04/04/2017 02:24 PM, Michael Wang wrote: > On 04/04/2017 12:23 PM, Michael Wang wrote: > [snip] >>> add something like >>> if (wbio->bi_next) >>> printk("bi_next!= NULL i=%d read_disk=%d bi_end_io=%pf\n", >>> i, r1_bio->read_disk, wbio->bi_end_io); >>> >>> that might help narr

Re: [RFC PATCH] blk: reset 'bi_next' when bio is done inside request

2017-04-04 Thread Michael Wang
On 04/04/2017 12:23 PM, Michael Wang wrote: [snip] >> add something like >> if (wbio->bi_next) >> printk("bi_next!= NULL i=%d read_disk=%d bi_end_io=%pf\n", >> i, r1_bio->read_disk, wbio->bi_end_io); >> >> that might help narrow down what is happening. > > Just triggered again in

Re: [RFC PATCH] blk: reset 'bi_next' when bio is done inside request

2017-04-04 Thread Michael Wang
On 04/04/2017 11:37 AM, NeilBrown wrote: > On Tue, Apr 04 2017, Michael Wang wrote: [snip] >>> >>> If sync_request_write() is using a bio that has already been used, it >>> should call bio_reset() and fill in the details again. >>> However I don't see how that would happen. >>> Can you give specif

Re: [RFC PATCH] blk: reset 'bi_next' when bio is done inside request

2017-04-04 Thread NeilBrown
On Tue, Apr 04 2017, Michael Wang wrote: > Hi, Neil > > On 04/03/2017 11:25 PM, NeilBrown wrote: >> On Mon, Apr 03 2017, Michael Wang wrote: >> >>> blk_attempt_plug_merge() try to merge bio into request and chain them >>> by 'bi_next', while after the bio is done inside request, we forgot to >>>

Re: [RFC PATCH] blk: reset 'bi_next' when bio is done inside request

2017-04-04 Thread Michael Wang
Hi, Neil On 04/03/2017 11:25 PM, NeilBrown wrote: > On Mon, Apr 03 2017, Michael Wang wrote: > >> blk_attempt_plug_merge() try to merge bio into request and chain them >> by 'bi_next', while after the bio is done inside request, we forgot to >> reset the 'bi_next'. >> >> This lead into BUG while

Re: [RFC PATCH] blk: reset 'bi_next' when bio is done inside request

2017-04-03 Thread NeilBrown
On Mon, Apr 03 2017, Michael Wang wrote: > blk_attempt_plug_merge() try to merge bio into request and chain them > by 'bi_next', while after the bio is done inside request, we forgot to > reset the 'bi_next'. > > This lead into BUG while removing all the underlying devices from md-raid1, > the bio

[RFC PATCH] blk: reset 'bi_next' when bio is done inside request

2017-04-03 Thread Michael Wang
blk_attempt_plug_merge() try to merge bio into request and chain them by 'bi_next', while after the bio is done inside request, we forgot to reset the 'bi_next'. This lead into BUG while removing all the underlying devices from md-raid1, the bio once go through: md_do_sync() sync_request()