]> git.ipfire.org Git - thirdparty/mdadm.git/commit
Grow: avoid overflow in compute_backup_blocks()
authorNeilBrown <neilb@suse.com>
Wed, 5 Dec 2018 23:35:41 +0000 (10:35 +1100)
committerJes Sorensen <jsorensen@fb.com>
Thu, 6 Dec 2018 12:56:21 +0000 (07:56 -0500)
commit085df42259cba7863cd6ebe5cd0d8492ac5b869e
tree95eabb294b2dd047a097a16b852d9da52c44326e
parent563ac108659980b3d1e226fe416254a86656235f
Grow: avoid overflow in compute_backup_blocks()

With a chunk size of 16Meg and data drive count of 8,
this calculate can easily overflow the 'int' type that
is used for the multiplications.
So force it to use "long" instead.

Reported-and-tested-by: Ed Spiridonov <edo.rus@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Grow.c