]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dm-integrity: fix a warning on invalid table line
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 22 Apr 2025 19:18:33 +0000 (21:18 +0200)
committerMikulas Patocka <mpatocka@redhat.com>
Wed, 23 Apr 2025 11:09:15 +0000 (13:09 +0200)
If we use the 'B' mode and we have an invalit table line,
cancel_delayed_work_sync would trigger a warning. This commit avoids the
warning.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
drivers/md/dm-integrity.c

index 2a283feb3319ca978e403dad572eee5943d1ec1a..cc3d3897ef428f38348479ef7f13db80cfe1f807 100644 (file)
@@ -5164,7 +5164,7 @@ static void dm_integrity_dtr(struct dm_target *ti)
        BUG_ON(!RB_EMPTY_ROOT(&ic->in_progress));
        BUG_ON(!list_empty(&ic->wait_list));
 
-       if (ic->mode == 'B')
+       if (ic->mode == 'B' && ic->bitmap_flush_work.work.func)
                cancel_delayed_work_sync(&ic->bitmap_flush_work);
        if (ic->metadata_wq)
                destroy_workqueue(ic->metadata_wq);