On 10/22/19 1:46 PM, Darrick J. Wong wrote: > 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> so we can't /set/ it to 0 or -1, and if it is, set it to -1. (!) but ok, -1 means disabled, so invalid value -> disabled. dbg_printf might be nice intead of silently ignoring but ... it's just a debug knob so Reviewed-by: Eric Sandeen <sandeen@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 >