]> git.ipfire.org Git - thirdparty/mdadm.git/commit - Grow.c
Grow: avoid overflow of chunk sizes.
authorNeilBrown <neilb@suse.de>
Thu, 29 Apr 2010 06:14:30 +0000 (16:14 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 29 Apr 2010 06:14:30 +0000 (16:14 +1000)
commit200871adf9e15d5ad985f28c349fd89c386ef48a
tree0c26b071611cb666bc2a4c81057a66ab979ce388
parent691c6ee1b6bb77bc44a5474d856771b0aec9882d
Grow: avoid overflow of chunk sizes.

Chunks aren't particularly big, but when you could them in bytes
and multiply them together (as we do for calculating the backup
size for 'grow') they can overflow a 32bit int.

So group the division by 512 more closely with the
chunk size so were would need 30Meg chunks to come close to
overflowing 32bits.

Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c