diff options
| author | Chen Yu <yu.c.chen@intel.com> | 2023-09-06 12:18:52 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-09-23 11:14:32 +0200 |
| commit | 7fd49a3cafca88495b81efb832d5edb38b75e1fe (patch) | |
| tree | e88e1c0c47b6a77b56234fd3a78d3620cef64558 /include/linux/instruction_pointer.h | |
| parent | 63565e1cbfb59da059dd322054840eb6a0019e65 (diff) | |
PM: hibernate: Fix the exclusive get block device in test_resume mode
[ Upstream commit 148b6f4cc3920e563094540fe1a12d00d3bbccae ]
Commit 5904de0d735b ("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: 5904de0d735b ("PM: hibernate: Do not get block device exclusively in test_resume mode")
Closes: https://lore.kernel.org/lkml/000000000000761f5f0603324129@google.com/
Reported-by: Pengfei Xu <pengfei.xu@intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Tested-by: Chenzhou Feng <chenzhoux.feng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux/instruction_pointer.h')
0 files changed, 0 insertions, 0 deletions
