lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 4 Mar 2015 13:44:18 +1100
From:	NeilBrown <neilb@...e.de>
To:	Stephen Rothwell <sfr@...b.auug.org.au>
Cc:	Goldwyn Rodrigues <rgoldwyn@...e.com>, linux-next@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: linux-next: build failure after merge of the md tree

On Tue, 3 Mar 2015 13:35:31 +1100 Stephen Rothwell <sfr@...b.auug.org.au>
wrote:

> Hi Neil,
> 
> On Mon, 2 Mar 2015 17:11:49 +1100 Stephen Rothwell <sfr@...b.auug.org.au> wrote:
> >
> > On Mon, 2 Mar 2015 17:03:45 +1100 NeilBrown <neilb@...e.de> wrote:
> > >
> > > I think
> > > +               bm_blocks = DIV_ROUND_UP(bm_blocks, 4096);
> > > 
> > > needs DIV_ROUND_UP_SECTOR_T()
> > 
> > I tried that and it was not sufficient.
> > 
> > > The first patch you identified adds that line.  The second relocates it.
> > 
> > The second also changes this:
> > 
> > bm_blocks = sector_div(bitmap->mddev->resync_max_sectors, (chunksize >> 9));
> > 
> > (added by the first) to this:
> > 
> > bm_blocks = bitmap->mddev->resync_max_sectors / (bitmap->mddev->bitmap_info.chunksize >> 9);
> > 
> > where bitmap->mddev->resync_max_sectors is a sector_t ...
> 
> So I applied this patch for today:
> 
> From: Stephen Rothwell <sfr@...b.auug.org.au>
> Date: Tue, 3 Mar 2015 13:30:26 +1100
> Subject: [PATCH] md/bitmap: use sector_div for sector_t divisions
> 
> Signed-off-by: Stephen Rothwell <sfr@...b.auug.org.au>
> ---
>  drivers/md/bitmap.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
> index 23f575f0cd92..d40398404ab6 100644
> --- a/drivers/md/bitmap.c
> +++ b/drivers/md/bitmap.c
> @@ -573,7 +573,8 @@ re_read:
>  	if (bitmap->cluster_slot >= 0) {
>  		long long bm_blocks;
>  
> -		bm_blocks = bitmap->mddev->resync_max_sectors / (bitmap->mddev->bitmap_info.chunksize >> 9);
> +		bm_blocks = sector_div(bitmap->mddev->resync_max_sectors,
> +				       bitmap->mddev->bitmap_info.chunksize >> 9);
>  		bm_blocks = bm_blocks << 3;
>  		bm_blocks = DIV_ROUND_UP_SECTOR_T(bm_blocks, 4096);
>  		bitmap->mddev->bitmap_info.offset += bitmap->cluster_slot * (bm_blocks << 3);


Thanks!
sector_div() leave the remainder in it's first argument, so this isn't quite
correct - you need to store resync_max_sectors in a temp variable.
So I made that change and applied you patch.

Thanks,
NeilBrown

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists