Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753254AbdDJLN5 (ORCPT ); Mon, 10 Apr 2017 07:13:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:34163 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753169AbdDJLN4 (ORCPT ); Mon, 10 Apr 2017 07:13:56 -0400 Date: Mon, 10 Apr 2017 13:13:53 +0200 From: David Sterba To: Adam Borowski Cc: Icenowy Zheng , Chris Mason , Josef Bacik , Fabio Estevam , linux-arm-kernel@lists.infradead.org, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] btrfs: scrub: use do_div() for 64-by-32 division Message-ID: <20170410111353.GX4781@suse.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Adam Borowski , Icenowy Zheng , Chris Mason , Josef Bacik , Fabio Estevam , linux-arm-kernel@lists.infradead.org, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <20170408210737.5456-1-kilobyte@angband.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170408210737.5456-1-kilobyte@angband.pl> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1373 Lines: 34 On Sat, Apr 08, 2017 at 11:07:37PM +0200, 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 > Signed-off-by: Adam Borowski > --- > You'd probably want to squash this with Liu's commit, to be nice to future > bisects. Thanks for finding it! > 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); I'll use the div_u64 helper instead, I don't want to reintroduce do_div to fs/btrfs , for-next will be updated in a minute.