From: Dmitry Kurochkin Date: Thu, 27 Oct 2011 22:44:20 +0000 (-0600) Subject: Do not allow max-swap-rate and swap-timeout reconfiguration for Rock Store. X-Git-Tag: BumpSslServerFirst.take01~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7846d08440dff203786f8bd51b3d69e001f601dc;p=thirdparty%2Fsquid.git Do not allow max-swap-rate and swap-timeout reconfiguration for Rock Store. These options are used to configure DiskIO module during Rock SwapDir initialization. During reconfiguration, the values are updated in Rock SwapDir, but they do not reach the DiskIO module. Thus, while Squid says that option has a new value, the new value is never really used. This patch fixes this inconsistency. In the future, we may support reconfiguration for max-swap-rate and swap-timeout, but that would require adding reconfiguration support to DiskIO modules. --- diff --git a/src/fs/rock/RockSwapDir.cc b/src/fs/rock/RockSwapDir.cc index 910239f109..77b62b6dcf 100644 --- a/src/fs/rock/RockSwapDir.cc +++ b/src/fs/rock/RockSwapDir.cc @@ -335,10 +335,13 @@ Rock::SwapDir::parseTimeOption(char const *option, const char *value, int reconf const time_msec_t newTime = static_cast(parsedValue); - if (reconfiguring && *storedTime != newTime) - debugs(3, DBG_IMPORTANT, "cache_dir " << path << ' ' << option << " is now " << newTime); - - *storedTime = newTime; + if (!reconfiguring) + *storedTime = newTime; + else if (*storedTime != newTime) { + debugs(3, DBG_IMPORTANT, "WARNING: cache_dir " << path << ' ' << option + << " cannot be changed dynamically, value left unchanged: " << + *storedTime); + } return true; } @@ -379,10 +382,13 @@ Rock::SwapDir::parseRateOption(char const *option, const char *value, int isaRec self_destruct(); } - if (isaReconfig && *storedRate != newRate) - debugs(3, DBG_IMPORTANT, "cache_dir " << path << ' ' << option << " is now " << newRate); - - *storedRate = newRate; + if (!isaReconfig) + *storedRate = newRate; + else if (*storedRate != newRate) { + debugs(3, DBG_IMPORTANT, "WARNING: cache_dir " << path << ' ' << option + << " cannot be changed dynamically, value left unchanged: " << + *storedRate); + } return true; }