]> git.baikalelectronics.ru Git - kernel.git/commit
bcache: put bch_bio_map() back to correct location in journal_write_unlocked()
authorColy Li <colyli@suse.de>
Tue, 19 Apr 2022 16:04:24 +0000 (00:04 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 19 Apr 2022 17:28:17 +0000 (11:28 -0600)
commitb0654c74814162e8e3f67126dea801b6167dd3c7
treeb0e470136e65d89576b4a2ff64db8902104d263b
parent03f6be76c72f401ccb1ce5f30974dbc39c785436
bcache: put bch_bio_map() back to correct location in journal_write_unlocked()

Commit 0705cc3924f9 ("block: pass a block_device and opf to bio_reset")
moves bch_bio_map() inside journal_write_unlocked() next to the location
where the modified bio_reset() was called.

This change is wrong because calling bch_bio_map() immediately after
bio_reset(), a BUG_ON(!bio->bi_iter.bi_size) inside bch_bio_map() will
be triggered and panic the kernel.

This patch puts bch_bio_map() back to its original correct location in
journal_write_unlocked() and avoid the BUG_ON().

Fixes: 0705cc3924f9 ("block: pass a block_device and opf to bio_reset")
Signed-off-by: Coly Li <colyli@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20220419160425.4148-2-colyli@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/journal.c