Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1619885
| From | "Austin S. Hemmelgarn" <ahferroin7@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] btrfs: scrub: use do_div() for 64-by-32 division |
| Date | 2017-04-10 15:00 +0200 |
| Message-ID | <tuH5g-M6-9@gated-at.bofh.it> (permalink) |
| References | <tu2EO-8jn-9@gated-at.bofh.it> <tu5Ml-24v-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 2017-04-08 17:07, Adam Borowski wrote:
> Unbreaks ARM and possibly other 32-bit architectures.
>
> Fixes: 7d0ef8b4d: Btrfs: update scrub_parity to use u64 stripe_len
> Reported-by: Icenowy Zheng <icenowy@aosc.io>
> Signed-off-by: Adam Borowski <kilobyte@angband.pl>
> ---
> You'd probably want to squash this with Liu's commit, to be nice to future
> bisects.
>
> Tested on amd64 where all is fine, and on arm (Odroid-U2) where scrub
> sometimes works, but, like most operations, randomly dies with some badness
> that doesn't look related: io_schedule, kunmap_high. That badness wasn't
> there in 4.11-rc5, needs investigating, but since it's not connected to our
> issue at hand, I consider this patch sort-of tested.
>
> fs/btrfs/scrub.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
> index b6fe1cd08048..95372e3679f3 100644
> --- a/fs/btrfs/scrub.c
> +++ b/fs/btrfs/scrub.c
> @@ -2407,7 +2407,7 @@ static inline void __scrub_mark_bitmap(struct scrub_parity *sparity,
>
> start -= sparity->logic_start;
> start = div64_u64_rem(start, sparity->stripe_len, &offset);
> - offset /= sectorsize;
> + do_div(offset, sectorsize);
> nsectors = (int)len / sectorsize;
>
> if (offset + nsectors <= sparity->nsectors) {
>
Also fixes things on:
32-bit MIPS (eb and el variants)
32-bit SPARC
32-bit PPC
You can add my Tested-by if you want.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Linux next-20170407 failed to build on ARM due to usage of mod in btrfs code Icenowy Zheng <icenowy@aosc.io> - 2017-04-08 18:10 +0200
Re: Linux next-20170407 failed to build on ARM due to usage of mod in btrfs code Fabio Estevam <festevam@gmail.com> - 2017-04-08 19:50 +0200
Re: Linux next-20170407 failed to build on ARM due to usage of mod in btrfs code Adam Borowski <kilobyte@angband.pl> - 2017-04-08 20:40 +0200
[PATCH] btrfs: scrub: use do_div() for 64-by-32 division Adam Borowski <kilobyte@angband.pl> - 2017-04-08 23:10 +0200
Re: [PATCH] btrfs: scrub: use do_div() for 64-by-32 division Adam Borowski <kilobyte@angband.pl> - 2017-04-09 06:10 +0200
Re: [PATCH] btrfs: scrub: use do_div() for 64-by-32 division Adam Borowski <kilobyte@angband.pl> - 2017-04-10 03:20 +0200
Re: [PATCH] btrfs: scrub: use do_div() for 64-by-32 division David Sterba <dsterba@suse.cz> - 2017-04-10 13:20 +0200
Re: [PATCH] btrfs: scrub: use do_div() for 64-by-32 division "Austin S. Hemmelgarn" <ahferroin7@gmail.com> - 2017-04-10 15:00 +0200
Re: [PATCH] btrfs: scrub: use do_div() for 64-by-32 division Liu Bo <bo.li.liu@oracle.com> - 2017-04-10 20:50 +0200
csiph-web