cswitch is unsigned, so don't compare it < 0. Any negative numbers

will look huge and be caught by > 100.
This commit is contained in:
Warner Losh 2014-08-07 21:56:42 +00:00
parent 86e26cb154
commit cba7d97b61
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=269692

View file

@ -172,7 +172,7 @@ g_journal_cache_switch_sysctl(SYSCTL_HANDLER_ARGS)
error = sysctl_handle_int(oidp, &cswitch, 0, req);
if (error != 0 || req->newptr == NULL)
return (error);
if (cswitch < 0 || cswitch > 100)
if (cswitch > 100)
return (EINVAL);
g_journal_cache_switch = cswitch;
g_journal_cache_low = (g_journal_cache_limit / 100) * cswitch;