mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-02 09:51:21 -04:00
bcachefs: Ensure we don't exceed encoded_extent_max
The write path may (rarely) see an encoded (checksummed) extent that exceeds encoded_extent_max - this can happen when we're moving an existing extent that was not checksummed, but was given a checksum by bch2_write_rechecksum(). Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
@@ -816,6 +816,7 @@ static enum prep_encoded_ret {
|
||||
|
||||
/* Can we just write the entire extent as is? */
|
||||
if (op->crc.uncompressed_size == op->crc.live_size &&
|
||||
op->crc.uncompressed_size <= c->opts.encoded_extent_max >> 9 &&
|
||||
op->crc.compressed_size <= wp->sectors_free &&
|
||||
(op->crc.compression_type == bch2_compression_opt_to_type(op->compression_opt) ||
|
||||
op->incompressible)) {
|
||||
|
||||
Reference in New Issue
Block a user