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:
parent
e677179b35
commit
2d39081291
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user