Received: by 2002:a05:622a:251a:b0:39a:b4a2:e86 with SMTP id cm26csp316691qtb; Wed, 19 Oct 2022 02:44:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7iGVPaAsz+JVmubgruXlV3GAwo/Ln+CkAgR5p/UYmBze0Qj43IkSboK2X3U7UQII1nkqFV X-Received: by 2002:a17:906:d550:b0:78d:a6d4:c18f with SMTP id cr16-20020a170906d55000b0078da6d4c18fmr6135999ejc.113.1666172656380; Wed, 19 Oct 2022 02:44:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172656; cv=none; d=google.com; s=arc-20160816; b=sFJs+rU+YqnnMfpL4cLvqI4GKAgct0IpEv3B4o3hGVJPFwANvSsZjzEf2y12KDNeMq mRtX3+sZ90r4Gu4aFrqdDXaUV5yKxyY5Jl5WhMQNkBumpxP24HqcU1/nll1jOegzovTq j7nlkM4JLBqSPM+7oB4K91e/enwXtcy8gAIzT2ZdHr5NzItUyApRcI+0HWXyyJftudBM R27cz1WhCMLMKWeGKIZChTowbbgOXuVIG9UFNlG40oTkWalaBBtvw/pmOwVCmX2BmGos TWyGoL+ofS0aZ/5XFC0xK4TBdu7rBEUB18IY1fYarB0K6mN5yr8eTu5R6zDgJUvYn+IB Kn+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uhyi8XXKLwO1H/adyFrV+0kKmWa7eXtGrU1+aQbBBmc=; b=VewIgMpKwlxnCF9VbDCoVRHSkGQcLBgFgqtZr31NejYXH9dYcDA4diAHE9dvnnTAUs BDFNNXWZBC6ohCtH6uzTyK/poxUh4akEV+d0HLaYWZmPEGwQzbfrchjbNSp0UY7X7QVE SynyXPC1VG9UezVB0puaWt9QP+ftYg+HwaAAQ1MGQpRzcx9bohwzndcud+jLAGtP3Y7+ JNT0KAzWWgDBS90AxQ5TzvmbZYuzSk0Knt8rEmdCp+0gTnEei/qZBvrN7X6bBRJaV8pr QP3mUom6B1Z4Ubu4zf/14SjWMrPkeSF86UR8waF3e9OpbcVt6iVG/TXwajrVLgJzAlfv 0s0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BVLNy6Hq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f10-20020a0564021e8a00b0045d29efdb5esi14567662edf.381.2022.10.19.02.43.38; Wed, 19 Oct 2022 02:44:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BVLNy6Hq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233836AbiJSJdB (ORCPT + 99 others); Wed, 19 Oct 2022 05:33:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233690AbiJSJ3G (ORCPT ); Wed, 19 Oct 2022 05:29:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8707AEA357; Wed, 19 Oct 2022 02:12:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2D76A6182C; Wed, 19 Oct 2022 09:02:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41B0CC433C1; Wed, 19 Oct 2022 09:02:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170156; bh=HvN8GzZzETVsezl8m80/slKJZZivatHf2m1FWyT3bAU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BVLNy6HqLTSizp/hM1eb2wflGI21Ot6CA1A4HzVgRm/vqcDldN8lwST1etqf7fWzM YomQgjDMWYRgW4n5I8qO5uWYzcc1XPd9aC3U3c4A6nqqnucZ2qT468JwA2mJZ/cPSA 7TUhDCXFO5RfzVZUtuRntJeRFL/r78GDuRzVmjbk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Song Liu , Logan Gunthorpe , Sasha Levin Subject: [PATCH 6.0 548/862] md/raid5: Ensure stripe_fill happens on non-read IO with journal Date: Wed, 19 Oct 2022 10:30:35 +0200 Message-Id: <20221019083314.173964506@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Logan Gunthorpe [ Upstream commit e2eed85bc75138a9eeb63863d20f8904ac42a577 ] 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: 07e83364845e ("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 Signed-off-by: Logan Gunthorpe Signed-off-by: Song Liu Signed-off-by: Sasha Levin --- drivers/md/raid5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 31a0cbf63384..4ec33fd62018 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -4047,7 +4047,7 @@ static void handle_stripe_fill(struct stripe_head *sh, * back cache (prexor with orig_page, and then xor with * page) in the read path */ - if (s->injournal && s->failed) { + if (s->to_read && s->injournal && s->failed) { if (test_bit(STRIPE_R5C_CACHING, &sh->state)) r5c_make_stripe_write_out(sh); goto out; -- 2.35.1