Skip to content
Commit 148b6f4c authored by Chen Yu's avatar Chen Yu Committed by Rafael J. Wysocki
Browse files

PM: hibernate: Fix the exclusive get block device in test_resume mode

Commit 5904de0d ("PM: hibernate: Do not get block device exclusively
in test_resume mode") fixes a hibernation issue under test_resume mode.
That commit is supposed to open the block device in non-exclusive mode
when in test_resume. However the code does the opposite, which is against
its description.

In summary, the swap device is only opened exclusively by swsusp_check()
with its corresponding *close(), and must be in non test_resume mode.
This is to avoid the race condition that different processes scribble the
device at the same time. All the other cases should use non-exclusive mode.

Fix it by really disabling exclusive mode under test_resume.

Fixes: 5904de0d ("PM: hibernate: Do not get block device exclusively in test_resume mode")
Closes: https://lore.kernel.org/lkml/000000000000761f5f0603324129@google.com/


Reported-by: default avatarPengfei Xu <pengfei.xu@intel.com>
Signed-off-by: default avatarChen Yu <yu.c.chen@intel.com>
Tested-by: default avatarChenzhou Feng <chenzhoux.feng@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 40d84e19
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment