lkml.org 
[lkml]   [2022]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] kernel: power: swap: Suppress expected 'Image not found' error on Ubuntu
Date
In 'systemctl hibernate' if resume device is written to the sysfs
resume parameter, a software_resume() call is triggerred. This call
is expected to fail in swsusp_check() call with -EBUSY error and an
'Image not found' error message. This fix suppresses the expected
failure message from getting logged in Ubuntu setups where
CONFIG_DYNAMIC_DEBUG is enabled by default.

Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
---
kernel/power/swap.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 277434b6c0bf..9cbd3edc8339 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -1552,6 +1552,14 @@ int swsusp_check(void)
pr_debug("Image signature found, resuming\n");
} else {
error = PTR_ERR(hib_resume_bdev);
+ /*
+ * If this call is triggered by `systemctl hibernate`, the
+ * call is expected to fail with -EBUSY error.
+ * TODO: Figure out a better way to suppress the error msg
+ * in this case.
+ */
+ if (error == -EBUSY)
+ return error;
}

if (error)
--
2.37.2
\
 
 \ /
  Last update: 2022-12-15 07:21    [W:0.084 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site