Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1935420rwd; Thu, 15 Jun 2023 18:45:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4YtrN8WMz+3mSWLD/1oceIh26mOxNGsnNTQA885flKmtosyUcDWg7J/hzJt+KrU++6SAcL X-Received: by 2002:a17:903:2696:b0:1b0:3576:c2b5 with SMTP id jf22-20020a170903269600b001b03576c2b5mr683604plb.7.1686879939640; Thu, 15 Jun 2023 18:45:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686879939; cv=none; d=google.com; s=arc-20160816; b=aUAh0raDgw3QtXg4uCQkp/qznFxnG0ArcZbbrZy4YpycXfoulj0pARhieUNcURKiOs EUs24fdJ9Ym/GgnM1svn0YMFCLU1FKccugJw2vRH7GB5yAT4qU9p+kH6jdvhYka7oBsD 1fwYIiTyg+gTICyBfma2gpwbTgV2cF1KUx9pkscv1l9+AEuGh+cRa4C+93sJhBl5TtDR 7G8a6kqCRYlsGCJBpfg+UsvS7s2d9eMLbKDFFI+1yD/FyiU5D14Zw9hTEJL9nzVCG9nS nx891UWnKeDp/L7k7+qSyn0ioWYEvzQxUN9656p06d2NNl9mkKpY6oZxqvBGDrqfE93T kzug== 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 :message-id:date:subject:cc:to:from; bh=Fh7wM5frNKrM+eY1KzlmWC++JvBy0cdjggDy6ieaX28=; b=lYYKYVs5cNBfhlXog6lSvDbfRmzFHfAcghLich6nNpHy/ptJRQMVTa4gL6ObMpOzH1 iKen0kRXHAsVRkjn6aivqEjbQ0fD2vnj/lhjP3YolehodBSaXtUNhj8X+cRrroWD92NA nCurXiSWlDZ/KuszoNgZhI7f4Ow5hx8sRZofGV4SYO35tCoYX1uAgAK6mtNMngrr8zhu f+brvi/+Okwe7FToG6hJabkiEBCOJ99ZkMwOuNHWKkNWEGnyAgpDe5UgnlCVQOvBGaBf pHH6iErNPJaNOg9AGdMAXzQXkyr9RefL7xX/2Ceiouo4LUs/qHoSEoTPOn9qwNFDuZXQ irNA== 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 p16-20020a170902e75000b001b3f2ba0917si6434667plf.108.2023.06.15.18.45.19; Thu, 15 Jun 2023 18:45:39 -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 S233088AbjFPB0V (ORCPT + 99 others); Thu, 15 Jun 2023 21:26:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230090AbjFPB0U (ORCPT ); Thu, 15 Jun 2023 21:26:20 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FA802D40; Thu, 15 Jun 2023 18:26:19 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4Qj1hQ6j3Dz4f3kp9; Fri, 16 Jun 2023 09:26:14 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP4 (Coremail) with SMTP id gCh0CgAHvbA0uotkbPc3Lw--.48109S4; Fri, 16 Jun 2023 09:26:14 +0800 (CST) From: Yu Kuai To: song@kernel.org, axboe@kernel.dk, nathan@kernel.org, ndesaulniers@google.com, yukuai3@huawei.com Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, yukuai1@huaweicloud.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: [PATCH] md/raid1-10: fix casting from randomized structure in raid1_submit_write() Date: Fri, 16 Jun 2023 09:21:36 +0800 Message-Id: <20230616012136.3047071-1-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgAHvbA0uotkbPc3Lw--.48109S4 X-Coremail-Antispam: 1UD129KBjvJXoW7trWxWrWkWr1Dury3XryrWFg_yoW8JFWkpa yj9ay5W3yUGrWUu3WDGFW8ua15Ka1qg3ya9a95Cw4aqa4YqFWDXa18t3yUJrn5AF1Fkry3 ZFyUKw4Fkw1UtFDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvY14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4U JVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gc CE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2 Y2ka0xkIwI1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4 xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43 MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I 0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE14v2 6r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0J UdHUDUUUUU= 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_NONE,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 Following build error triggered while build with clang version 17.0.0 with W=1(this can't be reporduced with gcc 13.1.0): drivers/md/raid1-10.c:117:25: error: casting from randomized structure pointer type 'struct block_device *' to 'struct md_rdev *' 117 | struct md_rdev *rdev = (struct md_rdev *)bio->bi_bdev; | ^ Fix this by casting 'bio->bi_bdev' to 'void *', as it used to be. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202306142042.fmjfmTF8-lkp@intel.com/ Fixes: 8295efbe68c0 ("md/raid1-10: factor out a helper to submit normal write") Signed-off-by: Yu Kuai --- drivers/md/raid1-10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.c index 169ebe296f2d..3f22edec70e7 100644 --- a/drivers/md/raid1-10.c +++ b/drivers/md/raid1-10.c @@ -116,7 +116,7 @@ static void md_bio_reset_resync_pages(struct bio *bio, struct resync_pages *rp, static inline void raid1_submit_write(struct bio *bio) { - struct md_rdev *rdev = (struct md_rdev *)bio->bi_bdev; + struct md_rdev *rdev = (void *)bio->bi_bdev; bio->bi_next = NULL; bio_set_dev(bio, rdev->bdev); -- 2.39.2