From cba7d97b6153caec9fb029fb5168d307b03161be Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 7 Aug 2014 21:56:42 +0000 Subject: [PATCH] cswitch is unsigned, so don't compare it < 0. Any negative numbers will look huge and be caught by > 100. --- sys/geom/journal/g_journal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/geom/journal/g_journal.c b/sys/geom/journal/g_journal.c index 52dbc36e733..9cc324c32a2 100644 --- a/sys/geom/journal/g_journal.c +++ b/sys/geom/journal/g_journal.c @@ -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;