[PATCH v3 0/2] Fix test_resume failure by openning swap device non-exclusively

Chen Yu posted 2 patches 2 years, 8 months ago
kernel/power/hibernate.c | 15 ++++++++++++---
kernel/power/power.h     |  1 +
kernel/power/swap.c      |  8 ++++++--
3 files changed, 19 insertions(+), 5 deletions(-)
[PATCH v3 0/2] Fix test_resume failure by openning swap device non-exclusively
Posted by Chen Yu 2 years, 8 months ago
test_resume does not work in current kernel when using swapfile for hibernation.
This is because the swap device should be openned non-exclusively in test_resume mode.

Patch 1 is a preparation to turn snapshot_test into a global variable.
Patch 2 is the fix to open swap device non-exclusively only for test_resume mode.

Change since v2:
Adjust the initialization of fmode and refine the commit message
per Rafael's suggestion.

Change since v1:
Turn snapshot_test into global variable and do not introduce parameters for swsusp_check()
nor load_image_and_restore().

Chen Yu (2):
  PM: hibernate: Turn snapshot_test into global variable
  PM: hibernate: Do not get block device exclusively in test_resume mode

 kernel/power/hibernate.c | 15 ++++++++++++---
 kernel/power/power.h     |  1 +
 kernel/power/swap.c      |  8 ++++++--
 3 files changed, 19 insertions(+), 5 deletions(-)

-- 
2.25.1
Re: [PATCH v3 0/2] Fix test_resume failure by openning swap device non-exclusively
Posted by Rafael J. Wysocki 2 years, 7 months ago
On Fri, Apr 14, 2023 at 6:14 AM Chen Yu <yu.c.chen@intel.com> wrote:
>
> test_resume does not work in current kernel when using swapfile for hibernation.
> This is because the swap device should be openned non-exclusively in test_resume mode.
>
> Patch 1 is a preparation to turn snapshot_test into a global variable.
> Patch 2 is the fix to open swap device non-exclusively only for test_resume mode.
>
> Change since v2:
> Adjust the initialization of fmode and refine the commit message
> per Rafael's suggestion.
>
> Change since v1:
> Turn snapshot_test into global variable and do not introduce parameters for swsusp_check()
> nor load_image_and_restore().
>
> Chen Yu (2):
>   PM: hibernate: Turn snapshot_test into global variable
>   PM: hibernate: Do not get block device exclusively in test_resume mode
>
>  kernel/power/hibernate.c | 15 ++++++++++++---
>  kernel/power/power.h     |  1 +
>  kernel/power/swap.c      |  8 ++++++--
>  3 files changed, 19 insertions(+), 5 deletions(-)
>
> --

Both applied as 6.4-rc material, thanks!