]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
dm: don't lock fs when the map is NULL during suspend or resume
authorLi Lingfeng <lilingfeng3@huawei.com>
Thu, 1 Jun 2023 06:14:23 +0000 (14:14 +0800)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Mon, 2 Oct 2023 15:19:13 +0000 (17:19 +0200)
commit0cc8315a96c5fa86bad7c5de62c9e4bee70b62d7
treecd267481e710555f74e7b67aa1bc724c02acfa3c
parent1ac80fe3a0253e3283f129f5d5db4bb69d49f2d5
dm: don't lock fs when the map is NULL during suspend or resume

BugLink: https://bugs.launchpad.net/bugs/2033931
[ Upstream commit 2760904d895279f87196f0fa9ec570c79fe6a2e4 ]

As described in commit 38d11da522aa ("dm: don't lock fs when the map is
NULL in process of resume"), a deadlock may be triggered between
do_resume() and do_mount().

This commit preserves the fix from commit 38d11da522aa but moves it to
where it also serves to fix a similar deadlock between do_suspend()
and do_mount().  It does so, if the active map is NULL, by clearing
DM_SUSPEND_LOCKFS_FLAG in dm_suspend() which is called by both
do_suspend() and do_resume().

Fixes: 38d11da522aa ("dm: don't lock fs when the map is NULL in process of resume")
Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/md/dm-ioctl.c
drivers/md/dm.c