From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Hannes Reinecke <hare@suse.de>
Cc: Chen Gang <gang.chen.5i5j@gmail.com>,
James Hogan <james.hogan@imgtec.com>,
linux-scsi@vger.kernel.org, target-devel@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Fengguang Wu <fengguang.wu@intel.com>
Subject: Re: [PATCH] drivers: target: target_core_mod: use div64_u64_rem() instead of operator '%' for u64
Date: Thu, 09 Jan 2014 21:47:51 -0800 [thread overview]
Message-ID: <1389332871.5567.358.camel@haakon3.risingtidesystems.com> (raw)
In-Reply-To: <52CE7720.6060809@suse.de>
On Thu, 2014-01-09 at 11:17 +0100, Hannes Reinecke wrote:
> On 01/09/2014 12:18 AM, Nicholas A. Bellinger wrote:
> > On Wed, 2014-01-08 at 08:32 +0100, Hannes Reinecke wrote:
<SNIP>
> >> Other than that the sector_div() patch is correct.
> >>
> >
> > <nod> Thanks for confirming that sector_div() is correct here vs. the
> > original code using modulo that Chen had pointed out.
> >
> Ah, _that_ was the issue.
> I was wondering why you kept on poking me ...
>
> Well.
> No, that's actually _not_ correct.
> The correct fix would be
>
> diff --git a/drivers/target/target_core_alua.c
> b/drivers/target/target_core_alua.c
> index 54b1e52..12da9b3 100644
> --- a/drivers/target/target_core_alua.c
> +++ b/drivers/target/target_core_alua.c
> @@ -500,8 +500,7 @@ static inline int core_alua_state_lba_dependent(
>
> if (segment_mult) {
> u64 tmp = lba;
> - sector_div(tmp, segment_size * segment_mult);
> - start_lba = tmp;
> + start_lba = sector_div(tmp, segment_size * segment_mult);
>
> last_lba = first_lba + segment_size - 1;
> if (start_lba >= first_lba &&
> (beware of line breaks ...)
> Thing is, we need to calculate the offset into the segment to figure out
> which map entry to use.
> The actual number of the segment (as had been calculated with the
> original fix) is immaterial here.
>
> Sorry for this. The email thread just flew past me during Xmas
> with me not paying real attention.
>
Applied + squashed. Apologies for the initial pre-holiday BUG..
Thanks Hannes!
--nab
next prev parent reply other threads:[~2014-01-10 5:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-21 2:08 Chen Gang
2013-12-22 2:56 ` Nicholas A. Bellinger
2013-12-22 9:17 ` Chen Gang
2013-12-23 6:51 ` Nicholas A. Bellinger
2013-12-24 3:35 ` Chen Gang
2014-01-08 7:32 ` Hannes Reinecke
2014-01-08 14:40 ` Chen Gang
2014-01-08 23:18 ` Nicholas A. Bellinger
2014-01-09 10:17 ` Hannes Reinecke
2014-01-10 5:47 ` Nicholas A. Bellinger [this message]
2014-01-10 16:06 ` Chen Gang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1389332871.5567.358.camel@haakon3.risingtidesystems.com \
--to=nab@linux-iscsi.org \
--cc=fengguang.wu@intel.com \
--cc=gang.chen.5i5j@gmail.com \
--cc=hare@suse.de \
--cc=james.hogan@imgtec.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=target-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®