Re: Issues with large chunk size (16Mb)

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

 



On Thu, Nov 29, 2018 at 4:57 AM NeilBrown <neilb@xxxxxxxx> wrote:
>
> On Thu, Nov 29 2018, Ed Spiridonov wrote:
>
> The problem is here:
>
>         blocks = (ochunk/512) * (nchunk/512) * odata * ndata / a;
>
> in compute_backup_blocks() in Grow.c in mdadm.

Thanks, this patch works to me

diff --git a/Grow.c b/Grow.c
index 4436a4d..383a1d1 100644
--- a/Grow.c
+++ b/Grow.c
@@ -1196,7 +1196,7 @@ unsigned long compute_backup_blocks(int nchunk,
int ochunk,
        /* Find GCD */
        a = GCD(a, b);
        /* LCM == product / GCD */
-       blocks = (ochunk/512) * (nchunk/512) * odata * ndata / a;
+       blocks = (unsigned long) (ochunk/512) * (nchunk/512) * odata *
ndata / a;

        return blocks;
 }



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux