Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6131693iog; Thu, 23 Jun 2022 12:01:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1swpkjFnRstOCDlR4ukp99ALiRtVRtdD5eoC4A/SXeEvoG606M3TJrNL6BXriospSFapyXX X-Received: by 2002:aa7:c9cf:0:b0:435:de3b:c499 with SMTP id i15-20020aa7c9cf000000b00435de3bc499mr2042530edt.321.1656010900262; Thu, 23 Jun 2022 12:01:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656010900; cv=none; d=google.com; s=arc-20160816; b=pec3JCF/mxGPeddj5SdogUqWzHzr0DhJU1x9ziKig6+YrqkxaqPIKrLyGzj7PL+tvw JHCGUu+pKFlNklcrDFhbxEsbnAqWAGM6iVZEh40ex5FDLmUc6v0u5w64ZGcnlIG2Ewpq IqrDdtg5fjoMLyianCS7R5n9mJW7mx942faEJLZNNY4cnzXzo6/btn8iE9dqDzexpr51 OWiiqN372dGGAEESG6kxlQOCINKbmkn7UTKPB9u42fFwPTb9MuK4E7ykRibYCfws3goZ 3VIV7jYh65nTx/EuFQlbcwlWj08xfQ7i6UKovIuHd1I75bRg8pEsndvTehdOyM2MwRYy JM3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=GWQK21UqKo/dJWySMXR2dCx6UiOlM8mymYQBvcKe9ok=; b=r94Xe0MBZmdq54zlVoOwYcZfZ1+6IORVafTHUV36MbZLAsVxswrDxihOwINwn0Lodc PXQjQ9sSJGRiHj+cGqvkDQ76owLtev2ti89ts0l1z19+NxVoRgjUu9zU/R7mUW7iSfky ZNuFYVM8hb5458VoQQSKl36agsRlaJ81OhhDQv8kuz0ZZN6FYH6Toz7HWzmGqy+bI6hT ZcNlEojjPCSvr67lAb7788eEzlTYVi96eCK3vWrKP94y68uakqx2OiSh3POuMVedyagL EfQwlm5EvKYAvaa144/wDjWdQGCS7ln8lGQxw15LRxq35mOUq02Gz/H/4c17N9tRVgxz G7eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mtxeAVFN; 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 i27-20020a170906265b00b00715867834e2si18400047ejc.499.2022.06.23.12.01.15; Thu, 23 Jun 2022 12:01:40 -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=mtxeAVFN; 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 S235338AbiFWR7s (ORCPT + 99 others); Thu, 23 Jun 2022 13:59:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235891AbiFWR5s (ORCPT ); Thu, 23 Jun 2022 13:57:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5E836F4B5; Thu, 23 Jun 2022 10:15:51 -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 3B63861E1D; Thu, 23 Jun 2022 17:15:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 672EEC341C6; Thu, 23 Jun 2022 17:15:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656004550; bh=8R+RW0DB9EQ2uVvtR45zq4/JAUy2m7hPxnil1cTbtlk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mtxeAVFNaaUOJEFUJk7ElG9DH1UpHpB/WNY7S4GrmCBJ31fzAmELxc5zbtlTNydIx FYkxzZ/oqMyAIiOJB9C42FooAnuW7HA2I2atqBgZ59duf9XuPRV+Zwny2acXTiTueu HG/G5bsTK5vZPQmSthSNalyuORED+RwbABSp254wcTd2GoZtGtYlBQHlnPOmCWzLtt vZIRaRd4RzSZaL7plFY0pX3htWj8+YcJJpTQvDKkDCYF7D5I6VdCUs8SES1J27w1cW IRESsHWyRF/hVr21wXjpueLL8Q05Xy9iHqA5UcGqf400nTnWxSqsXbmlmxsgulGt/+ vYpp/sE/CXecw== Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-3178acf2a92so870667b3.6; Thu, 23 Jun 2022 10:15:50 -0700 (PDT) X-Gm-Message-State: AJIora/hmev4rmtUmLQWZ7oc9DYvh68wHJvaN5cYi6PwC80TqEUfKR7W SvZCDPGwdvky0zSxG6UT4mx4iPyIZWn6sO2ibZo= X-Received: by 2002:a81:2f45:0:b0:317:71c7:fcdc with SMTP id v66-20020a812f45000000b0031771c7fcdcmr11702449ywv.73.1656004549455; Thu, 23 Jun 2022 10:15:49 -0700 (PDT) MIME-Version: 1.0 References: <20220623165552.38645-1-logang@deltatee.com> In-Reply-To: <20220623165552.38645-1-logang@deltatee.com> From: Song Liu Date: Thu, 23 Jun 2022 10:15:38 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] md/raid5: Fix divide type in raid5_make_request() To: Logan Gunthorpe Cc: open list , linux-raid , kernel test robot Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 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,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 23, 2022 at 9:56 AM Logan Gunthorpe wrote: > > 0day reports a build failure on the hexagon architecture: > > ld.lld: error: undefined symbol: __hexagon_udivdi3 > referenced by raid5.c > md/raid5.o:(raid5_make_request) in archive drivers/built-in.a > referenced by raid5.c > md/raid5.o:(raid5_make_request) in archive drivers/built-in.a > did you mean: __hexagon_udivsi3 > defined in: arch/hexagon/built-in.a(lib/udivsi3.o) > > This is caused by using DIV_ROUND_UP on a sector_t type. > > The actual value is known to be less than 256 so a wide 64bit divide > here is not desirable. Thus cast the argument to an int to ensure it > uses a 32bit divide. I force pushed an update that uses DIV_ROUND_UP_SECTOR_T instead. I guess that should also work? Thanks, Song > > Fixes: 681fb14a7100 ("md/raid5: Pivot raid5_make_request()") > Reported-by: kernel test robot > Signed-off-by: Logan Gunthorpe > --- > 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 5723a497108a..9d25696b793d 100644 > --- a/drivers/md/raid5.c > +++ b/drivers/md/raid5.c > @@ -6091,7 +6091,7 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi) > bi->bi_next = NULL; > > bitmap_set(ctx.sectors_to_do, 0, > - DIV_ROUND_UP(ctx.last_sector - logical_sector, > + DIV_ROUND_UP((int)(ctx.last_sector - logical_sector), > RAID5_STRIPE_SECTORS(conf))); > > pr_debug("raid456: %s, logical %llu to %llu\n", __func__, > > base-commit: 57c19f921f8081c1a9444dc7f3f6b3ea43fe612e > -- > 2.30.2 >