mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 21:56:42 +00:00
linux: add patch for failed fstrim command
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
e4e018c8cf
commit
b98bf57ee4
23
packages/linux/patches/linux-2.6.37-071-fstrim-0.1.patch
Normal file
23
packages/linux/patches/linux-2.6.37-071-fstrim-0.1.patch
Normal file
@ -0,0 +1,23 @@
|
||||
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,
|
Loading…
x
Reference in New Issue
Block a user