diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-07-09 11:16:33 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:23 -0400 |
commit | a6f4d5bb249cf6ac44d1a83c72584402b7e5f6ed (patch) | |
tree | c42f9f778643aee3098fb1a8f50e075aeb55bf88 /fs/bcachefs/compress.c | |
parent | 0fd7263e2e55d43317e85e9f7a4e67de9fa0ec90 (diff) | |
download | linux-stable-a6f4d5bb249cf6ac44d1a83c72584402b7e5f6ed.tar.gz linux-stable-a6f4d5bb249cf6ac44d1a83c72584402b7e5f6ed.tar.bz2 linux-stable-a6f4d5bb249cf6ac44d1a83c72584402b7e5f6ed.zip |
bcachefs: Fix moving compressed data
bio_uncompress_inplace() used to potentially need to extend the bio to
be big enough for the uncompressed data, which has become problematic
with multipage bvecs - but, the move extent path actually already
allocated the bios to be big enough for the uncompressed data.
The promote path needed to be fixed, though.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/compress.c')
-rw-r--r-- | fs/bcachefs/compress.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/fs/bcachefs/compress.c b/fs/bcachefs/compress.c index 1a51a8c3e95c..d350d917a8d4 100644 --- a/fs/bcachefs/compress.c +++ b/fs/bcachefs/compress.c @@ -241,19 +241,10 @@ int bch2_bio_uncompress_inplace(struct bch_fs *c, struct bio *bio, } /* - * might have to free existing pages and retry allocation from mempool - - * do this _after_ decompressing: + * XXX: don't have a good way to assert that the bio was allocated with + * enough space, we depend on bch2_move_extent doing the right thing */ - if (bio->bi_iter.bi_size < crc->live_size << 9) { - if (bch2_bio_alloc_pages(bio, (crc->live_size << 9) - - bio->bi_iter.bi_size, - GFP_NOFS)) { - bch2_bio_free_pages_pool(c, bio); - bio->bi_iter.bi_size = 0; - bio->bi_vcnt = 0; - bch2_bio_alloc_pages_pool(c, bio, crc->live_size << 9); - } - } + bio->bi_iter.bi_size = crc->live_size << 9; memcpy_to_bio(bio, bio->bi_iter, data.b + (crc->offset << 9)); |