Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932479AbdLOPtR (ORCPT ); Fri, 15 Dec 2017 10:49:17 -0500 Received: from mga01.intel.com ([192.55.52.88]:11310 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932168AbdLOPtN (ORCPT ); Fri, 15 Dec 2017 10:49:13 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,405,1508828400"; d="scan'208";a="18548996" Date: Fri, 15 Dec 2017 08:27:11 -0700 From: Scott Bauer To: Randy Dunlap Cc: dm-devel@redhat.com, snitzer@redhat.com, agk@redhat.com, linux-kernel@vger.kernel.org, keith.busch@intel.com, jonathan.derrick@intel.com Subject: Re: [PATCH v3 1/2] dm-unstripe: unstripe RAID 0/dm-striped device Message-ID: <20171215152710.djma3jau7dbdrnjr@sbauer-Z170X-UD5> References: <20171213213332.2914-1-scott.bauer@intel.com> <20171213213332.2914-2-scott.bauer@intel.com> <4540fbf0-81e3-57b4-91e6-e33d5b5c578b@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4540fbf0-81e3-57b4-91e6-e33d5b5c578b@infradead.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 701 Lines: 23 [snip] On Wed, Dec 13, 2017 at 04:11:44PM -0800, Randy Dunlap wrote: > > >= > Thanks, good catch. > > + tot_sec = i_size_read(bbdev->bd_inode) >> SECTOR_SHIFT; > > + mod = tot_sec % target->chunk_sectors; > > Did you build this on 32-bit also? Is that '%' OK on 32-bit? I've looked at this a bit and still can't figure out why this modulo operation would operate differently on a 32 versus a 64 bit platform? I know sector_t is config dependent but the sector_t should be promoted to 64 bit width during the modulo operation. Are you wondering whether sector_t is the right type for any of the math in this file? Perhaps we should be safe and only use u64s?