mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-06 00:47:56 -04:00
bcachefs: Don't submit bio in write path under lock
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
committed by
Kent Overstreet
parent
2d78737d96
commit
fbc519ab2e
@@ -1008,6 +1008,8 @@ static int bch2_write_extent(struct bch_write_op *op, struct write_point *wp)
|
||||
bkey_start_pos(&key_to_write->k),
|
||||
total_input >> 9);
|
||||
|
||||
bch2_alloc_sectors_done(c, wp);
|
||||
|
||||
dst->bi_end_io = bch2_write_endio;
|
||||
dst->bi_private = &op->cl;
|
||||
dst->bi_opf = REQ_OP_WRITE;
|
||||
@@ -1022,6 +1024,8 @@ static int bch2_write_extent(struct bch_write_op *op, struct write_point *wp)
|
||||
"rewriting existing data (memory corruption?)");
|
||||
ret = -EIO;
|
||||
err:
|
||||
bch2_alloc_sectors_done(c, wp);
|
||||
|
||||
if (to_wbio(dst)->bounce)
|
||||
bch2_bio_free_pages_pool(c, dst);
|
||||
if (to_wbio(dst)->put_bio)
|
||||
@@ -1072,10 +1076,9 @@ static void __bch2_write(struct closure *cl)
|
||||
goto flush_io;
|
||||
}
|
||||
|
||||
ret = bch2_write_extent(op, wp);
|
||||
|
||||
bch2_open_bucket_get(c, wp, &op->open_buckets);
|
||||
bch2_alloc_sectors_done(c, wp);
|
||||
|
||||
ret = bch2_write_extent(op, wp);
|
||||
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
Reference in New Issue
Block a user