dm cache: set needs_check flag after aborting metadata
authorMike Snitzer <snitzer@kernel.org>
Wed, 30 Nov 2022 19:02:47 +0000 (14:02 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jan 2023 11:07:36 +0000 (12:07 +0100)
commit67a4e294c4cb1bbb3f836554ad614ce5aca109b4
tree3eacb80a133ef81c113bd81406e027b117e9948c
parent034cbc8d3b47a56acd89453c29632a9c117de09d
dm cache: set needs_check flag after aborting metadata

commit 6b9973861cb2e96dcd0bb0f1baddc5c034207c5c upstream.

Otherwise the commit that will be aborted will be associated with the
metadata objects that will be torn down.  Must write needs_check flag
to metadata with a reset block manager.

Found through code-inspection (and compared against dm-thin.c).

Cc: stable@vger.kernel.org
Fixes: 028ae9f76f29 ("dm cache: add fail io mode and needs_check flag")
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-cache-target.c