mirror of
https://github.com/LibreELEC/LibreELEC.tv
synced 2025-09-24 19:46:01 +07:00
24 lines
876 B
Diff
24 lines
876 B
Diff
diff -Naur linux-2.6.37/fs/ext4/mballoc.c linux-2.6.37.patch/fs/ext4/mballoc.c
|
|
--- linux-2.6.37/fs/ext4/mballoc.c 2011-01-05 01:50:19.000000000 +0100
|
|
+++ linux-2.6.37.patch/fs/ext4/mballoc.c 2011-01-11 16:40:40.592434028 +0100
|
|
@@ -4819,6 +4819,8 @@
|
|
ext4_group_t group, ngroups = ext4_get_groups_count(sb);
|
|
ext4_grpblk_t cnt = 0, first_block, last_block;
|
|
uint64_t start, len, minlen, trimmed;
|
|
+ ext4_fsblk_t first_data_blk =
|
|
+ le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block);
|
|
int ret = 0;
|
|
|
|
start = range->start >> sb->s_blocksize_bits;
|
|
@@ -4828,6 +4830,10 @@
|
|
|
|
if (unlikely(minlen > EXT4_BLOCKS_PER_GROUP(sb)))
|
|
return -EINVAL;
|
|
+ if (start < first_data_blk) {
|
|
+ len -= first_data_blk - start;
|
|
+ start = first_data_blk;
|
|
+ }
|
|
|
|
/* Determine first and last group to examine based on start and len */
|
|
ext4_get_group_no_and_offset(sb, (ext4_fsblk_t) start,
|