1 From: Jan Kara <jack@suse.cz>
2 Subject: Fix assertion failure in mballoc code
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.
11 Signed-off-by: Jan Kara <jack@suse.cz>
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
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;
25 current_block = ext4_mb_new_blocks(handle, &ar, err);