md/raid5: Make logic blocking check consistent with logic that blocks
authorLogan Gunthorpe <logang@deltatee.com>
Thu, 16 Jun 2022 19:19:31 +0000 (13:19 -0600)
committerSong Liu <song@kernel.org>
Sun, 3 Jul 2022 14:55:39 +0000 (07:55 -0700)
commitcc69f703f7af795981c09e1b08bba01f257405fa
treec657c5cf69ec01a4f2ca49849f6dfb396028ff6a
parent0c48c3be92add65a95c6dd037292fb1647ba0044
md/raid5: Make logic blocking check consistent with logic that blocks

The check in raid5_make_request differs very slightly from the logic
that causes it to block lower down. This likely does not cause a bug
as the check is fuzzy anyway (as reshape may move on between the first
check and the subsequent check). However, make it consistent so it can
be cleaned up in a subsequent patch.

The condition which causes the schedule is:

 !(mddev->reshape_backwards ? logical_sector < conf->reshape_progress :
   logical_sector >= conf->reshape_progress) &&
  (mddev->reshape_backwards ? logical_sector < conf->reshape_safe :
   logical_sector >= conf->reshape_safe)

The condition that causes the early bailout is made to match this.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Song Liu <song@kernel.org>
drivers/md/raid5.c