FreeBSD Bugzilla – Attachment 182549 Details for
Bug 198500
[gjournal] sysctl kern.geom.journal.cache.limit 32 bit integer overflow
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for stable/11
gjournal.diff (text/plain), 2.34 KB, created by
Eugene Grosbein
on 2017-05-12 18:56:57 UTC
(
hide
)
Description:
patch for stable/11
Filename:
MIME Type:
Creator:
Eugene Grosbein
Created:
2017-05-12 18:56:57 UTC
Size:
2.34 KB
patch
obsolete
>--- g_journal.c.orig 2016-11-19 19:37:56.480906000 +0700 >+++ g_journal.c 2017-05-13 01:48:44.209113000 +0700 >@@ -130,26 +130,26 @@ SYSCTL_PROC(_kern_geom_journal, OID_AUTO > SYSCTL_UINT(_kern_geom_journal, OID_AUTO, optimize, CTLFLAG_RW, > &g_journal_do_optimize, 0, "Try to combine bios on flush and copy"); > >-static u_int g_journal_cache_used = 0; >-static u_int g_journal_cache_limit = 64 * 1024 * 1024; >+static u_long g_journal_cache_used = 0; >+static u_long g_journal_cache_limit = 64 * 1024 * 1024; > static u_int g_journal_cache_divisor = 2; > static u_int g_journal_cache_switch = 90; > static u_int g_journal_cache_misses = 0; > static u_int g_journal_cache_alloc_failures = 0; >-static u_int g_journal_cache_low = 0; >+static u_long g_journal_cache_low = 0; > > static SYSCTL_NODE(_kern_geom_journal, OID_AUTO, cache, CTLFLAG_RW, 0, > "GEOM_JOURNAL cache"); >-SYSCTL_UINT(_kern_geom_journal_cache, OID_AUTO, used, CTLFLAG_RD, >+SYSCTL_ULONG(_kern_geom_journal_cache, OID_AUTO, used, CTLFLAG_RD, > &g_journal_cache_used, 0, "Number of allocated bytes"); > static int > g_journal_cache_limit_sysctl(SYSCTL_HANDLER_ARGS) > { >- u_int limit; >+ u_long limit; > int error; > > limit = g_journal_cache_limit; >- error = sysctl_handle_int(oidp, &limit, 0, req); >+ error = sysctl_handle_long(oidp, &limit, 0, req); > if (error != 0 || req->newptr == NULL) > return (error); > g_journal_cache_limit = limit; >@@ -157,7 +157,7 @@ g_journal_cache_limit_sysctl(SYSCTL_HAND > return (0); > } > SYSCTL_PROC(_kern_geom_journal_cache, OID_AUTO, limit, >- CTLTYPE_UINT | CTLFLAG_RWTUN, NULL, 0, g_journal_cache_limit_sysctl, "I", >+ CTLTYPE_ULONG | CTLFLAG_RWTUN, NULL, 0, g_journal_cache_limit_sysctl, "LU", > "Maximum number of allocated bytes"); > SYSCTL_UINT(_kern_geom_journal_cache, OID_AUTO, divisor, CTLFLAG_RDTUN, > &g_journal_cache_divisor, 0, >@@ -3022,9 +3022,9 @@ g_journal_switcher(void *arg) > kproc_exit(0); > } > if (error == 0 && g_journal_sync_requested == 0) { >- GJ_DEBUG(1, "Out of cache, force switch (used=%u " >- "limit=%u).", g_journal_cache_used, >- g_journal_cache_limit); >+ GJ_DEBUG(1, "Out of cache, force switch (used=%jd " >+ "limit=%jd).", (intmax_t)g_journal_cache_used, >+ (intmax_t)g_journal_cache_limit); > } > GJ_TIMER_START(1, &bt); > g_journal_do_switch(mp);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 198500
: 182549