mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Fixes a possible integer overflow in scrub counting.
This commit is contained in:
parent
df6445a572
commit
624212d7d4
2 changed files with 4 additions and 2 deletions
4
HISTORY
4
HISTORY
|
|
@ -1,9 +1,11 @@
|
|||
SnapRAID HISTORY
|
||||
================
|
||||
|
||||
5.3 2014/1 (BETA)
|
||||
5.3 2014/2
|
||||
=================
|
||||
* Don't warn about UUID changed if it's for an empty disk.
|
||||
* Fixed the number of blocks that scrub has to process when
|
||||
selecting a high percentage of the array.
|
||||
|
||||
5.2 2013/12
|
||||
===========
|
||||
|
|
|
|||
2
scrub.c
2
scrub.c
|
|
@ -471,7 +471,7 @@ int state_scrub(struct snapraid_state* state, int percentage, int olderthan)
|
|||
recentlimit = now;
|
||||
} else if (percentage != -1 || olderthan != -1) {
|
||||
if (percentage != -1)
|
||||
countlimit = (blockmax * percentage + 99) / 100;
|
||||
countlimit = (blockmax * (uint64_t)percentage + 99) / 100;
|
||||
else
|
||||
countlimit = blockmax;
|
||||
if (olderthan != -1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue