diff mbox series

[1/1] PM: hibernate: flush swap writer after marking

Message ID 20210122161941.1080-2-laurentbadel@eaton.com
State New
Headers show
Series PM: hibernate: Fix swap file marking | expand

Commit Message

Badel, Laurent Jan. 22, 2021, 4:19 p.m. UTC
Flush the swap writer after, not before, marking the files, to ensure the
signature is properly written. 

Signed-off-by: Laurent Badel <laurentbadel@eaton.com>
---
 kernel/power/swap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rafael J. Wysocki Jan. 25, 2021, 5:55 p.m. UTC | #1
On Fri, Jan 22, 2021 at 5:49 PM Laurent Badel <laurentbadel@eaton.com> wrote:
>

> Flush the swap writer after, not before, marking the files, to ensure the

> signature is properly written.

>

> Signed-off-by: Laurent Badel <laurentbadel@eaton.com>

> ---

>  kernel/power/swap.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/kernel/power/swap.c b/kernel/power/swap.c

> index c73f2e295167..72e33054a2e1 100644

> --- a/kernel/power/swap.c

> +++ b/kernel/power/swap.c

> @@ -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)

> --


Applied as 5.11-rc material, thanks!
diff mbox series

Patch

diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index c73f2e295167..72e33054a2e1 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -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)