Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2180802rwd; Thu, 15 Jun 2023 23:45:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6DG+LSCPBB/sIS9ctwrQUFEG9ksuAYVsBOJ3FI+dZdypKcFKYgX/Yu519wVhz6mc0RFtqn X-Received: by 2002:a17:902:d4cb:b0:1ad:ea13:1916 with SMTP id o11-20020a170902d4cb00b001adea131916mr1458125plg.21.1686897948374; Thu, 15 Jun 2023 23:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686897948; cv=none; d=google.com; s=arc-20160816; b=BUeAmW2MjDf2KRwxpLCIJOjBVEshm9OA3aRSK6MSF8DJzR/Hx8oRt7KAkv3Ehdffuw 2BFmdXu+NUK8tvRRtycKPzyzK4L3bqKw5EuRwhq4nU9p+ZBYu7hp8IITU3fG1His1Z/Z P4GOnJDo62gzSYaoiTHniJp/L0nW5UNR1Ej4AB9nXRIoBpiknJYcy+BYGNPKGlAfPwv4 ruFYP/9sSjdQ5TGXTqh7r+25PjeoJ7Lx2Q9SH1S7ye/9+WSBLAOPmh6rAnr+2lw4iRga dkNTCpLhFg6oBwn+sJr54wEs8YmRGypuqcJ7fq5yJVOQxMR/f67EkmrnkfHaa5j21jLE 10/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=KQp2dFOqbY9i5QCct02InkCQ8PPXL4TAsDOivAk3MzY=; b=Ws8aaJSbGQMd/oPez8LIuueFz+kNmu83f4Ehdf8ZK3sXoKvlVoOwj7Ohm7knZTmxfC 6QEsvQhYG6iJZiqvy2IWA0Rql6Pko6LSMpXGfMfbEu1+yCd1xJC8PF6XeoI3+Ya5Qizz glC0khKcrQs3Mybng+4zWSDcHyHu47j/CLSvaJVvqS6AfHCrdsCmLCVarM9EreBVyZf4 UKfMYBTH7Kq/oQZqmQYPNs5OdDarTTeLPqfgcqV2HMAjPEAnhQqYNcLGX8rjvzdlkQK6 IG1EBfyJYkxK5kqrS3agh3CLR9jIJ0ZAjiSTe6M1BeapyK3eAReY3bSJ/S7stRTF8Xqx jlyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WwCkCulQ; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o9-20020a170902d4c900b001b3c9bf5360si10072940plg.251.2023.06.15.23.45.34; Thu, 15 Jun 2023 23:45:48 -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=@kernel.org header.s=k20201202 header.b=WwCkCulQ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230419AbjFPGbd (ORCPT + 99 others); Fri, 16 Jun 2023 02:31:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244549AbjFPG3u (ORCPT ); Fri, 16 Jun 2023 02:29:50 -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 81F8D49E8; Thu, 15 Jun 2023 23:28:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 25E7862527; Fri, 16 Jun 2023 06:28:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 652CBC433C8; Fri, 16 Jun 2023 06:28:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686896881; bh=NK6NuNFj6+ESLJk6aKbG68bt0tVJtq65SC771NXQPfg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WwCkCulQ6VNP6YtmzKbofwhV7Z2+OKi2JPo0GjlVrFuD+Ok0Yq/Gg++NnVw+iYMDr 5iz7p5PFY3HafVtWf0I9vr3r09RSpQJ9oJO0rQRExuh7qb1Jzg/rfAXSb4jYhl9K/J o+7Yz8vSs0P484qhoE2tlZssstXQQo4MiOGQmx7e2otY0gNALtDe2W9igNHZLeL1jX /OiOwBr+65CIlNbJ0DJGBH4bGj6MQFO3zt/BWScq+/3OemQKsAwqulJMMpQE6jOsP3 Jq7RpQ2U069FvzGKo3OICqcDDPjwpXHjmOBQ0yZuvD1CtxmLCfg3u0O9V2AtOhPTp/ kTek1+U/Omx6w== Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-4f84d70bf96so504605e87.0; Thu, 15 Jun 2023 23:28:01 -0700 (PDT) X-Gm-Message-State: AC+VfDzXr+xxr83tsm6t8dc8yMWBB/sHvHgFjqzeyZHI8f5HLVNTrP22 OMgFdEkUjBhWFFFcTNL/Wu32s7g8vmqa2ogOb0Q= X-Received: by 2002:a05:6512:1289:b0:4f6:19c3:da30 with SMTP id u9-20020a056512128900b004f619c3da30mr2240526lfs.29.1686896879390; Thu, 15 Jun 2023 23:27:59 -0700 (PDT) MIME-Version: 1.0 References: <20230616012136.3047071-1-yukuai1@huaweicloud.com> In-Reply-To: <20230616012136.3047071-1-yukuai1@huaweicloud.com> From: Song Liu Date: Thu, 15 Jun 2023 23:27:47 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] md/raid1-10: fix casting from randomized structure in raid1_submit_write() To: Yu Kuai Cc: axboe@kernel.dk, nathan@kernel.org, ndesaulniers@google.com, yukuai3@huawei.com, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, yi.zhang@huawei.com, yangerkun@huawei.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 On Thu, Jun 15, 2023 at 6:26=E2=80=AFPM Yu Kuai w= rote: > > From: Yu Kuai > > Following build error triggered while build with clang version 17.0.0 > with W=3D1(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 =3D (struct md_rdev *)bio->bi_bde= v; > | ^ > > 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@int= el.com/ > Fixes: 8295efbe68c0 ("md/raid1-10: factor out a helper to submit normal w= rite") > Signed-off-by: Yu Kuai Applied to md-next. Thanks, Song > --- > 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 =3D (struct md_rdev *)bio->bi_bdev; > + struct md_rdev *rdev =3D (void *)bio->bi_bdev; > > bio->bi_next =3D NULL; > bio_set_dev(bio, rdev->bdev); > -- > 2.39.2 >