]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
dm thin metadata: check if in fail_io mode when setting needs_check
authorMike Snitzer <snitzer@redhat.com>
Tue, 2 Jul 2019 19:50:08 +0000 (15:50 -0400)
committerKhalid Elmously <khalid.elmously@canonical.com>
Thu, 26 Sep 2019 04:34:52 +0000 (00:34 -0400)
commitca8ed6b7ba973a5884b40fd669a8baa7aeb0b7c5
treecf76ca2db41d5b677ff40167af72f55867dbe248
parent55247cb266e7c335113c7b1dfafa0f88969c804e
dm thin metadata: check if in fail_io mode when setting needs_check

BugLink: https://bugs.launchpad.net/bugs/1844558
[ Upstream commit 54fa16ee532705985e6c946da455856f18f63ee1 ]

Check if in fail_io mode at start of dm_pool_metadata_set_needs_check().
Otherwise dm_pool_metadata_set_needs_check()'s superblock_lock() can
crash in dm_bm_write_lock() while accessing the block manager object
that was previously destroyed as part of a failed
dm_pool_abort_metadata() that ultimately set fail_io to begin with.

Also, update DMERR() message to more accurately describe
superblock_lock() failure.

Cc: stable@vger.kernel.org
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/md/dm-thin-metadata.c