From patchwork Sat Oct 22 07:25:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7793 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1123872wrr; Sat, 22 Oct 2022 02:34:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5CrfW776lwdhxybf6P5a7iSqHKo56OVBggen46sx3fyey5UWds2jUx2zz+V6lCu5PHeP14 X-Received: by 2002:a17:906:730e:b0:78d:94ab:77c2 with SMTP id di14-20020a170906730e00b0078d94ab77c2mr19334522ejc.639.1666431287437; Sat, 22 Oct 2022 02:34:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666431287; cv=none; d=google.com; s=arc-20160816; b=UDACXiLQQUJ4/pbBWFajdY4UEGXygwyh9FVv3JARJRKpAflRMalzWVk3v9EAQmz7mx IDMDkBJZQT1FvclVh36zRrRFo/Gr4yFq35nGfiXabmn2sIa6mArdFR44BWdztIUNEa3w 2J8ROiDJW/Khxku/9QiSFQ+HjX0ZMpJpnM2xeZSA8+5PafpJw4vShphwULDb6NESUlHQ nZm4RHRbfW6EDIOPReD9rzouhMFis2CW01L1hTizfJZYik0Ug8/yOkKI23DC+9skSOoQ EMTODgstsg5Tts04YhP6PXGqc6OYqnnxzVpmOg3T8bI0Ahm7vjnH9zixcULQvSkn2o9b kCxQ== 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=Aiv41OAiLQVYbSDQor8+efxAmfzbonTHXY9YOEK91/0=; b=ZOEGBpqldpiBespcGUEwboaXX+amsuCBWV32iZXqava06zMIqn4fFYeeNE96U+9ubU LetsOTAyh/FOIgtQ/DRggOv44f+5d7iwcbz1TJVw9fX03oaIw16iVRfDGMMNc7wfh9sd t0x/ccieZVFRWI7vQ1uNCfjt9w/wch/7YYsEhfETYRg4GUS9GhhbpHXLnd37YpWEFu+k lfDsKsBt6Zu4Jfve69ZuMg0zP/CSWVHVasXgGOQ4/sZ+el7sdikyeoRU7LLtp2bUIS7U W8ggtKGRSdan7PQI7BUQNnZ26100Ui9VbUWyILG/o5UDq4EMur2uQMxd4oYeGyDlVWhO W0Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qvgwAB0o; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot1-20020a170906ccc100b007799e328e10si19961355ejb.999.2022.10.22.02.34.23; Sat, 22 Oct 2022 02:34:47 -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=qvgwAB0o; 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 S231327AbiJVJSR (ORCPT + 99 others); Sat, 22 Oct 2022 05:18:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231538AbiJVJRn (ORCPT ); Sat, 22 Oct 2022 05:17:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA95B300732; Sat, 22 Oct 2022 01:31:50 -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 095C360B26; Sat, 22 Oct 2022 07:54:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDF30C433C1; Sat, 22 Oct 2022 07:54:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425249; bh=r7PNaX5jg937K92lGyiHI6AtzHOXbs4MRgqduWtMwJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qvgwAB0oLcKPDLBq5ABvQo3SvJbeqG46i6ijZ43V/auglPliGfimCX5lNerl2xhac nuV4m9BFNwNtsRjLMKN6zbi6Iu+xxQInUDJnnu8wsGokNg06W50mdxO7scX1CWIQxP ye7dt1M+e2qCT3z00J3KQRKbL8wpx2DCW1Ix05dI= 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 5.19 440/717] md/raid5: Ensure stripe_fill happens on non-read IO with journal Date: Sat, 22 Oct 2022 09:25:19 +0200 Message-Id: <20221022072517.796434253@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747379853810599160?= X-GMAIL-MSGID: =?utf-8?q?1747379853810599160?= 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 1c1310d539f2..d6cad962669a 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -3951,7 +3951,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;