]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid5: Ensure stripe_fill happens on non-read IO with journal
authorLogan Gunthorpe <logang@deltatee.com>
Thu, 25 Aug 2022 15:46:27 +0000 (09:46 -0600)
committerSong Liu <song@kernel.org>
Thu, 22 Sep 2022 07:05:04 +0000 (00:05 -0700)
commit18f8ff68dc6e01cc2f5dfa3285ff835c4aa48268
tree18bc71d8320d56d06083017a37c13dfb0dccabe6
parent7128ddaacab5f0419187a5b5222d74d618efff39
md/raid5: Ensure stripe_fill happens on non-read IO with journal

When doing degrade/recover tests using the journal a kernel BUG
is hit at drivers/md/raid5.c:4381 in handle_parity_checks5():

  BUG_ON(!test_bit(R5_UPTODATE, &dev->flags));

This was found to occur because handle_stripe_fill() was skipped
for stripes in the journal due to a condition in that function.
Thus blocks were not fetched and R5_UPTODATE was not set when
the code reached handle_parity_checks5().

To fix this, don't skip handle_stripe_fill() unless the stripe is
for read.

Fixes: c0ad6091bae6 ("md/r5cache: shift complex rmw from read path to write path")
Link: https://lore.kernel.org/linux-raid/e05c4239-41a9-d2f7-3cfa-4aa9d2cea8c1@deltatee.com/
Suggested-by: Song Liu <song@kernel.org>
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Song Liu <song@kernel.org>
drivers/md/raid5.c