Skip to content

Commit cd1635d

Browse files
committed
md/raid5: fix IO hang with degraded array with llbitmap
When llbitmap bit state is still unwritten, any new write should force rcw, as bitmap_ops->blocks_synced() is checked in handle_stripe_dirtying(). However, later the same check is missing in need_this_block(), causing stripe to deadloop during handling because handle_stripe() will decide to go to handle_stripe_fill(), meanwhile need_this_block() always return 0 and nothing is handled. Link: https://lore.kernel.org/linux-raid/[email protected] Fixes: 5ab829f ("md/md-llbitmap: introduce new lockless bitmap") Signed-off-by: Yu Kuai <[email protected]> Reviewed-by: Li Nan <[email protected]>
1 parent 5d1dd57 commit cd1635d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

drivers/md/raid5.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3751,9 +3751,14 @@ static int need_this_block(struct stripe_head *sh, struct stripe_head_state *s,
37513751
struct r5dev *dev = &sh->dev[disk_idx];
37523752
struct r5dev *fdev[2] = { &sh->dev[s->failed_num[0]],
37533753
&sh->dev[s->failed_num[1]] };
3754+
struct mddev *mddev = sh->raid_conf->mddev;
3755+
bool force_rcw = false;
37543756
int i;
3755-
bool force_rcw = (sh->raid_conf->rmw_level == PARITY_DISABLE_RMW);
37563757

3758+
if (sh->raid_conf->rmw_level == PARITY_DISABLE_RMW ||
3759+
(mddev->bitmap_ops && mddev->bitmap_ops->blocks_synced &&
3760+
!mddev->bitmap_ops->blocks_synced(mddev, sh->sector)))
3761+
force_rcw = true;
37573762

37583763
if (test_bit(R5_LOCKED, &dev->flags) ||
37593764
test_bit(R5_UPTODATE, &dev->flags))

0 commit comments

Comments
 (0)