]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bcache: use bio cloning for detached device requests
authorShida Zhang <zhangshida@kylinos.cn>
Thu, 22 Jan 2026 06:13:21 +0000 (14:13 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 22 Jan 2026 14:24:50 +0000 (07:24 -0700)
commit3ef825dfd4e487d6f92b23ee2df2455814583ef4
treeb62810459fe6f4db4dda68dcefe83b099354438f
parent046be7e5967ef80547f7fd8a399e932f5338d5d4
bcache: use bio cloning for detached device requests

Previously, bcache hijacked the bi_end_io and bi_private fields of
the incoming bio when the backing device was in a detached state.
This is fragile and breaks if the bio is needed to be processed by
other layers.

This patch transitions to using a cloned bio embedded within a private
structure. This ensures the original bio's metadata remains untouched.

Fixes: 53280e398471 ("bcache: fix improper use of bi_end_io")
Co-developed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Shida Zhang <zhangshida@kylinos.cn>
Acked-by: Coly Li <colyli@fnnas.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/bcache.h
drivers/md/bcache/request.c
drivers/md/bcache/super.c