linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Damien Le Moal <Damien.LeMoal@wdc.com>
To: Nathan Chancellor <natechancellor@gmail.com>,
	Alasdair Kergon <agk@redhat.com>,
	Mike Snitzer <snitzer@redhat.com>
Cc: "dm-devel@redhat.com" <dm-devel@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [dm-devel] [PATCH] dm zoned: Avoid 64-bit division error in dmz_fixup_devices
Date: Thu, 14 May 2020 06:25:02 +0000	[thread overview]
Message-ID: <BY5PR04MB690080527BC91E2DC9EDF0BBE7BC0@BY5PR04MB6900.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20200513084521.461116-1-natechancellor@gmail.com

On 2020/05/14 14:07, Nathan Chancellor wrote:
> When building arm32 allyesconfig:
> 
> ld.lld: error: undefined symbol: __aeabi_uldivmod
>>>> referenced by dm-zoned-target.c
>>>>               md/dm-zoned-target.o:(dmz_ctr) in archive drivers/built-in.a
> 
> dmz_fixup_devices uses DIV_ROUND_UP with variables of type sector_t. As
> such, it should be using DIV_ROUND_UP_SECTOR_T, which handles this
> automatically.
> 
> Fixes: 70978208ec91 ("dm zoned: metadata version 2")
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
>  drivers/md/dm-zoned-target.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/md/dm-zoned-target.c b/drivers/md/dm-zoned-target.c
> index ea43f6892ced..9c4fd4b04878 100644
> --- a/drivers/md/dm-zoned-target.c
> +++ b/drivers/md/dm-zoned-target.c
> @@ -803,8 +803,9 @@ static int dmz_fixup_devices(struct dm_target *ti)
>  
>  	if (reg_dev) {
>  		reg_dev->zone_nr_sectors = zoned_dev->zone_nr_sectors;
> -		reg_dev->nr_zones = DIV_ROUND_UP(reg_dev->capacity,
> -						 reg_dev->zone_nr_sectors);
> +		reg_dev->nr_zones =
> +			DIV_ROUND_UP_SECTOR_T(reg_dev->capacity,
> +					      reg_dev->zone_nr_sectors);>  		zoned_dev->zone_offset = reg_dev->nr_zones;
>  	}
>  	return 0;
> 
> base-commit: e098d7762d602be640c53565ceca342f81e55ad2
> 

Looks good.

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>

-- 
Damien Le Moal
Western Digital Research

      reply	other threads:[~2020-05-14  6:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13  8:45 [PATCH] dm zoned: Avoid 64-bit division error in dmz_fixup_devices Nathan Chancellor
2020-05-14  6:25 ` Damien Le Moal [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BY5PR04MB690080527BC91E2DC9EDF0BBE7BC0@BY5PR04MB6900.namprd04.prod.outlook.com \
    --to=damien.lemoal@wdc.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=snitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).