mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
PM: hibernate: Emit an error when image writing fails
If image writing fails, a return code is passed up to the caller, but
none of the callers log anything to the log and so the only record
of it is the return code that userspace gets.
Adjust the logging so that the image size and speed of writing is
only emitted on success and if there is an error, it's saved to the
logs.
Fixes: a06c6f5d3c ("PM: hibernate: Move to crypto APIs for LZO compression")
Reported-by: Askar Safin <safinaskar@gmail.com>
Closes: https://lore.kernel.org/linux-pm/20251105180506.137448-1-safinaskar@gmail.com/
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Tested-by: Askar Safin <safinaskar@gmail.com>
Cc: 6.9+ <stable@vger.kernel.org> # 6.9+
[ rjw: Added missing braces after "else", changelog edits ]
Link: https://patch.msgid.link/20251106045158.3198061-2-superm1@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
committed by
Rafael J. Wysocki
parent
6146a0f1df
commit
62b9ca1706
@@ -877,11 +877,14 @@ out_finish:
|
||||
stop = ktime_get();
|
||||
if (!ret)
|
||||
ret = err2;
|
||||
if (!ret)
|
||||
if (!ret) {
|
||||
swsusp_show_speed(start, stop, nr_to_write, "Wrote");
|
||||
pr_info("Image size after compression: %d kbytes\n",
|
||||
(atomic_read(&compressed_size) / 1024));
|
||||
pr_info("Image saving done\n");
|
||||
swsusp_show_speed(start, stop, nr_to_write, "Wrote");
|
||||
pr_info("Image size after compression: %d kbytes\n",
|
||||
(atomic_read(&compressed_size) / 1024));
|
||||
} else {
|
||||
pr_err("Image saving failed: %d\n", ret);
|
||||
}
|
||||
|
||||
out_clean:
|
||||
hib_finish_batch(&hb);
|
||||
|
||||
Reference in New Issue
Block a user