PM: hibernate: flush swap writer after marking
authorLaurent Badel <laurentbadel@eaton.com>
Fri, 22 Jan 2021 16:19:41 +0000 (17:19 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 25 Jan 2021 17:52:30 +0000 (18:52 +0100)
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>
kernel/power/swap.c

index c73f2e2..72e3305 100644 (file)
@@ -497,10 +497,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)