Re: [PATCH] fast-import: export correctly marks larger than 2^20-1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 13, 2010 at 4:51 AM, Raja R Harinath <harinath@xxxxxxxxxxxx> wrote:
> dump_marks_helper() has a bug when dumping marks larger than 2^20-1,
> i.e., when the sparse array has more than two levels.  The bug was
> that the 'base' counter was being shifted by 20 bits at level 3, and
> then again by 10 bits at level 2, rather than a total shift of 20 bits
> in this argument to the recursive call:
>
>  (base + k) << m->shift
>
> There are two ways to fix this correctly, the elegant:
>
>  (base + k) << 10
>
> and the one I chose due to edit distance:
>
>  base + (k << m->shift)
>
> Cc: Shawn O. Pearce <spearce@xxxxxxxxxxx>
> Signed-off-by: Raja R Harinath <harinath@xxxxxxxxxxxx>

Dang, that's a very old bug.  This change makes sense, thanks.

Acked-by: Shawn O. Pearce <spearce@xxxxxxxxxxx>

-- 
Shawn.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]