From: Xueshi Hu <xueshi.hu@xxxxxxxxxx> All the r1bio should be freed before raid1_reshape() changes the mempool. However, freeze_array() doesn't guarantee there's no r1bio, as some r1bio maybe queued. Also, in raid1_write_request() and handle_read_error(), kernel shall not allow_barrier() before the r1bio is properly handled. Changes in v2: - fix the problem one by one instead of calling blk_mq_freeze_queue() as suggested by Yu Kuai Xueshi Hu (3): md/raid1: gave up reshape in case there's queued io md/raid1: free old r1bio before retry write md/raid1: keep holding the barrier in handle_read_error() drivers/md/raid1.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) -- 2.40.1