block: check if a profile is actually registered in blk_integrity_unregister
authorChristoph Hellwig <hch@lst.de>
Tue, 14 Sep 2021 07:06:55 +0000 (09:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Sep 2021 08:11:06 +0000 (10:11 +0200)
commit1963bdb7489cee29472b84e9cdc41b4a09a8b0d6
treec3cf73bcd1b5301ee9f275f8fbc1d56a4be7ca29
parent526261c1b706fec0ea80ce9f14c8fe8468bee34d
block: check if a profile is actually registered in blk_integrity_unregister

[ Upstream commit 783a40a1b3ac7f3714d2776fa8ac8cce3535e4f6 ]

While clearing the profile itself is harmless, we really should not clear
the stable writes flag if it wasn't set due to a registered integrity
profile.

Reported-by: Lihong Kou <koulihong@huawei.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Link: https://lore.kernel.org/r/20210914070657.87677-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
block/blk-integrity.c