]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dm cache: fix write hang in passthrough mode
authorMing-Hung Tsai <mtsai@redhat.com>
Mon, 9 Feb 2026 07:54:07 +0000 (15:54 +0800)
committerMikulas Patocka <mpatocka@redhat.com>
Mon, 2 Mar 2026 15:49:35 +0000 (16:49 +0100)
commit4ca8b8bd952df7c3ccdc68af9bd3419d0839a04b
tree577230170f828a1ef6c327292879f5ed3856870d
parent0c5eef0aad508231d8e43ff8392692925e131b68
dm cache: fix write hang in passthrough mode

The invalidate_remove() function has incomplete logic for handling write
hit bios after cache invalidation. It sets up the remapping for the
overwrite_bio but then drops it immediately without submission, causing
write operations to hang.

Fix by adding a new invalidate_committed() continuation that submits
the remapped writes to the cache origin after metadata commit completes,
while using the overwrite_endio hook to ensure proper completion
sequencing. This maintains existing coherency. Also improve error
handling in invalidate_complete() to preserve the original error status
instead of using bio_io_error() unconditionally.

Fixes: b29d4986d0da ("dm cache: significant rework to leverage dm-bio-prison-v2")
Signed-off-by: Ming-Hung Tsai <mtsai@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
drivers/md/dm-cache-target.c