]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.fixes/ext4-mballoc-preallocate.patch
Merge branch 'master' of git://git.ipfire.org/ipfire-2.x
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.fixes / ext4-mballoc-preallocate.patch
1 From: Jan Kara <jack@suse.cz>
2 Subject: Fix assertion failure in mballoc code
3 References: bnc#480749
4 Patch-mainline: 2.6.28
5
6 Backport of ext4 changes made a mistake and we enabled preallocation also for
7 non-regular files. This is not expected by the mballoc code and so we
8 eventually hit an assertion failure. Disable preallocation for non-regular
9 files as mainline does.
10
11 Signed-off-by: Jan Kara <jack@suse.cz>
12
13 diff -rupX /home/jack/.kerndiffexclude linux-2.6.27-SLE11_BRANCH/fs/ext4/inode.c linux-2.6.27-SLE11_BRANCH-1-ext4_mballoc_fix/fs/ext4/inode.c
14 --- linux-2.6.27-SLE11_BRANCH/fs/ext4/inode.c 2009-03-10 16:07:41.000000000 +0100
15 +++ linux-2.6.27-SLE11_BRANCH-1-ext4_mballoc_fix/fs/ext4/inode.c 2009-03-10 16:09:05.000000000 +0100
16 @@ -600,7 +600,9 @@ static int ext4_alloc_blocks(handle_t *h
17 ar.goal = goal;
18 ar.len = target;
19 ar.logical = iblock;
20 - ar.flags = EXT4_MB_HINT_DATA;
21 + if (S_ISREG(inode->i_mode))
22 + /* preallocate only for regular files */
23 + ar.flags = EXT4_MB_HINT_DATA;
24
25 current_block = ext4_mb_new_blocks(handle, &ar, err);
26