From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Don't allow zero or negative values from XFS_SCRUB_DISK_ERROR_INTERVAL to slip into the system. This is a debugging knob so we don't need to be rigorous, but we can at least take care of obvious garbage values. Coverity-id: 1454842 Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> --- scrub/disk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scrub/disk.c b/scrub/disk.c index 214a5346..8a8a411b 100644 --- a/scrub/disk.c +++ b/scrub/disk.c @@ -303,6 +303,10 @@ disk_simulate_read_error( interval = strtoull(p, NULL, 10); interval &= ~((1U << disk->d_lbalog) - 1); } + if (interval <= 0) { + interval = -1; + return 0; + } /* * We simulate disk errors by pretending that there are media errors at