summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2025-03-18 02:29:07 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-03-18 02:29:07 +0100
commite900fafc3b2d0885371acc35ef6bc41df86ac8fb (patch)
tree4e6969e957e7adc587f7b0a0772dc97b8cc67738
parentc180703603f314ef83c39aae5a15c83c72918a64 (diff)
ext2fs: extend end check for ext2_free_blocks
Since it can free more than one block.
-rw-r--r--ext2fs/balloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext2fs/balloc.c b/ext2fs/balloc.c
index fc09c0d1..231ab589 100644
--- a/ext2fs/balloc.c
+++ b/ext2fs/balloc.c
@@ -65,7 +65,7 @@ ext2_free_blocks (block_t block, unsigned long count)
/* Trap trying to free superblock, block group descriptor table, or beyond the end */
assert_backtrace (block >= group_desc_block_end
- && block < store->size >> log2_block_size);
+ && block + count <= store->size >> log2_block_size);
pthread_spin_lock (&global_lock);