diff mbox series

[SRU,F/aws,1/2] PM: hibernate: flush swap writer after marking

Message ID 20210311155101.98612-2-andrea.righi@canonical.com
State New
Headers show
Series aws: fix hibernation issues on c5.18xlarge | expand

Commit Message

Andrea Righi March 11, 2021, 3:51 p.m. UTC
From: Laurent Badel <laurentbadel@eaton.com>

BugLink: https://bugs.launchpad.net/bugs/1918694

Flush the swap writer after, not before, marking the files, to ensure the
signature is properly written.

Fixes: 6f612af57821 ("PM / Hibernate: Group swap ops")
Signed-off-by: Laurent Badel <laurentbadel@eaton.com>
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit fef9c8d28e28a808274a18fbd8cc2685817fd62a)
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
---
 kernel/power/swap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 7286fd82d875..b55b59c5336d 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -578,10 +578,10 @@  static int swap_writer_finish(struct swap_map_handle *handle,
 		unsigned int flags, int error)
 {
 	if (!error) {
-		flush_swap_writer(handle);
 		pr_info("S");
 		error = mark_swapfiles(handle, flags);
 		pr_cont("|\n");
+		flush_swap_writer(handle);
 	}
 
 	if (error)