mbox series

[v6,0/3] md/raid1: call free_r1bio() before allow_barrier()

Message ID 20230814135356.1113639-1-xueshi.hu@smartx.com (mailing list archive)
Headers show
Series md/raid1: call free_r1bio() before allow_barrier() | expand

Message

Xueshi Hu Aug. 14, 2023, 1:53 p.m. UTC
Because raid reshape changes the r1conf::raid_disks and the mempool, it
orders that there's no in-flight r1bio when reshaping. However, the
current caller of allow_barrier() allows the reshape
operation to proceed even if the old r1bio requests have not been freed.

-> v2:
	- fix the problem one by one instead of calling
	blk_mq_freeze_queue() as suggested by Yu Kuai
-> v3:
	- add freeze_array_totally() to replace freeze_array() instead
	  of gave up in raid1_reshape()
	- add a missed fix in raid_end_bio_io()
	- add a small check at the start of raid1_reshape()
-> v4:
	- add fix tag and revise the commit message
	- drop patch 1 as there is an ongoing systematic fix for the bug
	- drop patch 3 as it's unrelated which will be sent in
	another patch
-> v5:
	- split the patch into three parts, with each individual patch fix
	one bug.
-> v6:
	- drop the fix tag in patch 1.


Xueshi Hu (3):
  md/raid1: call free_r1bio() before allow_barrier()
  md/raid1: free the r1bio firstly before waiting for blocked rdev
  md/raid1: keep the barrier held until handle_read_error() finished

 drivers/md/raid1.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

Comments

Song Liu Aug. 14, 2023, 4:40 p.m. UTC | #1
On Mon, Aug 14, 2023 at 9:54 PM Xueshi Hu <xueshi.hu@smartx.com> wrote:
>
> Because raid reshape changes the r1conf::raid_disks and the mempool, it
> orders that there's no in-flight r1bio when reshaping. However, the
> current caller of allow_barrier() allows the reshape
> operation to proceed even if the old r1bio requests have not been freed.

Applied v6 to md-next after updating some commit log.

Thanks,
Song

>
> -> v2:
>         - fix the problem one by one instead of calling
>         blk_mq_freeze_queue() as suggested by Yu Kuai
> -> v3:
>         - add freeze_array_totally() to replace freeze_array() instead
>           of gave up in raid1_reshape()
>         - add a missed fix in raid_end_bio_io()
>         - add a small check at the start of raid1_reshape()
> -> v4:
>         - add fix tag and revise the commit message
>         - drop patch 1 as there is an ongoing systematic fix for the bug
>         - drop patch 3 as it's unrelated which will be sent in
>         another patch
> -> v5:
>         - split the patch into three parts, with each individual patch fix
>         one bug.
> -> v6:
>         - drop the fix tag in patch 1.
>
>
> Xueshi Hu (3):
>   md/raid1: call free_r1bio() before allow_barrier()
>   md/raid1: free the r1bio firstly before waiting for blocked rdev
>   md/raid1: keep the barrier held until handle_read_error() finished
>
>  drivers/md/raid1.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
>
> --
> 2.40.1
>