From patchwork Sat Apr 8 21:07:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Borowski X-Patchwork-Id: 9671291 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DCCDF601EB for ; Sat, 8 Apr 2017 21:08:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE6CB1FFD6 for ; Sat, 8 Apr 2017 21:08:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C180E28421; Sat, 8 Apr 2017 21:08:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 55F581FFD6 for ; Sat, 8 Apr 2017 21:08:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ok+ftmWsQmkBOXqc0BVUlgrKTKwT33EWdykjsgjoV64=; b=KbguP1j4p1d96p 9rx8cVIjRmza7048QTE16mYKYG8DnzP8Fg4t2FNFjgbaBnReQq9lDA0S+txoPfL4PDqQsxDF6R732 B+PTaLhH/gFLA7qIyzkUGEESkYzCRrKDTY+zJC8rAsH4Z53czB+EBOeUuiSBSyp0t3emRTJArFmcD nTeI/mTNNoMNH4TMh3Iuxjh105RXIyecINUQvohkY50IfDZRUJ6hwkYlPkWQpsLmAiZYpMR3NmOiA vNjXhb7f2k7/5BE7O4IWBiy/sXlnZuJTO0XAb+WG+LuUm2Rd4fQEZuRlRSUl3nwBko5B8XYLmJgXb a1De4/6EWlOSjf4J88/Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cwxas-0001tM-O9; Sat, 08 Apr 2017 21:08:26 +0000 Received: from tartarus.angband.pl ([2a03:9300:10::8]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cwxam-0001q1-MM for linux-arm-kernel@lists.infradead.org; Sat, 08 Apr 2017 21:08:23 +0000 Received: from umbar.angband.pl ([2001:6a0:118::6]) by tartarus.angband.pl with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.88) (envelope-from ) id 1cwxaD-0000Sm-ET; Sat, 08 Apr 2017 23:07:49 +0200 Received: from kilobyte by umbar.angband.pl with local (Exim 4.89) (envelope-from ) id 1cwxaC-0001Rx-O9; Sat, 08 Apr 2017 23:07:44 +0200 From: Adam Borowski To: Chris Mason , Josef Bacik , David Sterba , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, Icenowy Zheng , Fabio Estevam Date: Sat, 8 Apr 2017 23:07:37 +0200 Message-Id: <20170408210737.5456-1-kilobyte@angband.pl> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-SA-Exim-Connect-IP: 2001:6a0:118::6 X-SA-Exim-Mail-From: kilobyte@angband.pl Subject: [PATCH] btrfs: scrub: use do_div() for 64-by-32 division X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on tartarus.angband.pl) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170408_140820_913000_E7F03572 X-CRM114-Status: UNSURE ( 8.75 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Adam Borowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Liu Bo --- 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) {