PM: hibernate: Turn snapshot_test into global variable
authorChen Yu <yu.c.chen@intel.com>
Fri, 14 Apr 2023 12:10:26 +0000 (20:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:38 +0000 (23:03 +0900)
commit208ba216cc9020e9b94e4c601d3419bb4fb7587f
tree53c3e24eea8fef3d92881ec2506e0adda4da46f8
parentfc3153a91486b95f8987a849a7080e18c9baf36f
PM: hibernate: Turn snapshot_test into global variable

[ Upstream commit 08169a162f97819d3e5b4a342bb9cf5137787154 ]

There is need to check snapshot_test and open block device
in different mode, so as to avoid the race condition.

No functional changes intended.

Suggested-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: 5904de0d735b ("PM: hibernate: Do not get block device exclusively in test_resume mode")
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/power/hibernate.c
kernel/power/power.h