mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
Commit5904de0d73("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:5904de0d73("PM: hibernate: Do not get block device exclusively in test_resume mode") Closes: https://lore.kernel.org/lkml/[email protected]/ Reported-by: Pengfei Xu <[email protected]> Signed-off-by: Chen Yu <[email protected]> Tested-by: Chenzhou Feng <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>