lkml.org 
[lkml]   [2022]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -next v4 6/6] mm/zswap: skip confusing print info
Date
It's confusing when we disable zswap while zswap is init failed or has no
pool. If no change required, just return directly.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
mm/zswap.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/mm/zswap.c b/mm/zswap.c
index dac1714c7eda..be466ccf489b 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -886,6 +886,15 @@ static int zswap_zpool_param_set(const char *val,
static int zswap_enabled_param_set(const char *val,
const struct kernel_param *kp)
{
+ bool res;
+
+ if (kstrtobool(val, &res))
+ return -EINVAL;
+
+ /* no change required */
+ if (res == *(bool *)kp->arg)
+ return 0;
+
if (system_state == SYSTEM_RUNNING) {
mutex_lock(&zswap_init_lock);
if (zswap_setup()) {
--
2.25.1
\
 
 \ /
  Last update: 2022-08-29 15:00    [W:0.062 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site