Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3134814rwe; Mon, 29 Aug 2022 06:29:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR6yZN/xx1FDzIActal2b3HaSCdLANgBiUACNCgZnLAB6vnySsMhkSg7UMEsx3asqPtv5KX2 X-Received: by 2002:a17:902:a418:b0:174:6711:92c1 with SMTP id p24-20020a170902a41800b00174671192c1mr11389472plq.146.1661779754282; Mon, 29 Aug 2022 06:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661779754; cv=none; d=google.com; s=arc-20160816; b=HQhfs2mFSSID61qxCIKg9cfqA+DwI4J2I1Q6d6FkhxWV5IgbqfUvx5+8La4KcAXb96 TWsV1qsbkKdpqyfBunuYllQoytoZ9xKjvaaBUZlm2D8FlZvANtJn5UXAwR06J+/u0lVY OUk9I0vD1awQs0bsNxBmSf3MfccO55dcDIDUSM9wQ6r90XDjYITv4UeDIZuPe4yHDgOJ KsiTk9gUCa73nQPSj1PDIUZgBdQ5O3x4mDFcM89uuVDqb/rzy/Yz7MHYxr1rB+cdo/vT SsAhDTYEVWUNfZs0N7ytQiuHS9O8JLnpSBeW2FRw23RAfHMeguvjEADOSMYkisBwzj4G YxSQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=TjVJW3NahNWVYnJcEp7HgIq6goLgMH9JpcdjZLyS5l0=; b=szEdxZvBbzoLTBvlicsrQCSRko4L7AH6UjQOhMxt/es9V0q0l0PPNxF+ngabrrEmOv oADzuIUpo99GjbgJAt/xK/koQkCrMsApecxh+LcmKa4UC3tkSOYAyZqcLrKVtqFb3iei 9Ejgs3PB3fdkEYPveivzGtKZpIVsUvYOYQbYtCG42vdeQal0dt+epRg/i0veZYcPp9DY Hc73Ekq5iNcLOlXZ4y8BwLVdjaClBuIakE3yK9YbsKzOR4bnfBBM+Gl/hEs5wV1Msi4c y3lzYqBInO0DVWTf4T4Xsl9IXzpG4GQv1hnqSrV3k3tRbJ7rzZ1CTGsUibXhhMtQvrxL ivag== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k18-20020a170902d59200b0016d5fcd3f51si8980036plh.442.2022.08.29.06.29.03; Mon, 29 Aug 2022 06:29:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230169AbiH2NIw (ORCPT + 99 others); Mon, 29 Aug 2022 09:08:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230262AbiH2NI3 (ORCPT ); Mon, 29 Aug 2022 09:08:29 -0400 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 046A76C11B; Mon, 29 Aug 2022 06:03:43 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4MGVvb0d8Wz6Q1c0; Mon, 29 Aug 2022 21:02:03 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP4 (Coremail) with SMTP id gCh0CgB3PY0ruQxjk7hcAA--.5381S5; Mon, 29 Aug 2022 21:03:41 +0800 (CST) From: Yu Kuai To: song@kernel.org Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com Subject: [PATCH -next 1/3] md/raid10: fix improper BUG_ON() in raise_barrier() Date: Mon, 29 Aug 2022 21:15:00 +0800 Message-Id: <20220829131502.165356-2-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220829131502.165356-1-yukuai1@huaweicloud.com> References: <20220829131502.165356-1-yukuai1@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgB3PY0ruQxjk7hcAA--.5381S5 X-Coremail-Antispam: 1UD129KBjvdXoW7XF4xtF18uFykAFy5tw48Crg_yoWfJFbE93 Z5uF129r1ft347Kw1rKF4fZrWIgw1v9rnF9ayrKw43Zas8ZFWrC3WUXw48XwnxWay7Xr43 ZryIgFyDAF1DCjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb-kFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUGwA2048vs2IY02 0Ec7CjxVAFwI0_JFI_Gr1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM2 8EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AI xVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20x vE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xv r2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxAIw28IcxkI7VAKI48JMxC20s 026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_ JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14 v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xva j40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JV W8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUbzBT7UUUUU== X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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: Yu Kuai 'conf->barrier' is protected by 'conf->resync_lock', reading 'conf->barrier' without holding the lock is wrong. Signed-off-by: Yu Kuai --- drivers/md/raid10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 9117fcdee1be..b70c207f7932 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -930,8 +930,8 @@ static void flush_pending_writes(struct r10conf *conf) static void raise_barrier(struct r10conf *conf, int force) { - BUG_ON(force && !conf->barrier); spin_lock_irq(&conf->resync_lock); + BUG_ON(force && !conf->barrier); /* Wait until no block IO is waiting (unless 'force') */ wait_event_lock_irq(conf->wait_barrier, force || !conf->nr_waiting, -- 2.31.1