Skip to content

Commit edce7cb

Browse files
lsgunthgregkh
authored andcommitted
md/raid5: Ensure stripe_fill happens on non-read IO with journal
[ Upstream commit e2eed85 ] 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: 07e8336 ("md/r5cache: shift complex rmw from read path to write path") Link: https://lore.kernel.org/linux-raid/[email protected]/ Suggested-by: Song Liu <[email protected]> Signed-off-by: Logan Gunthorpe <[email protected]> Signed-off-by: Song Liu <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 41ca950 commit edce7cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/md/raid5.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3951,7 +3951,7 @@ static void handle_stripe_fill(struct stripe_head *sh,
39513951
* back cache (prexor with orig_page, and then xor with
39523952
* page) in the read path
39533953
*/
3954-
if (s->injournal && s->failed) {
3954+
if (s->to_read && s->injournal && s->failed) {
39553955
if (test_bit(STRIPE_R5C_CACHING, &sh->state))
39563956
r5c_make_stripe_write_out(sh);
39573957
goto out;

0 commit comments

Comments
 (0)