From: Aneesh Kumar K.V Date: Tue, 24 Feb 2009 17:14:53 +0000 (-0500) Subject: ext4: Initialize preallocation list_head's properly X-Git-Tag: v2.6.27.20~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5c99a7b06f7691d6756a12f60bae9892187c98dd;p=thirdparty%2Fkernel%2Fstable.git ext4: Initialize preallocation list_head's properly (cherry picked from commit d794bf8e0936dce45104565cd48c571061f4c1e3) When creating a new ext4_prealloc_space structure, we have to initialize its list_head pointers before we add them to any prealloc lists. Otherwise, with list debug enabled, we will get list corruption warnings. Signed-off-by: Aneesh Kumar K.V Signed-off-by: "Theodore Ts'o" Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index adb23f9fc1ba8..39d7cc185ee82 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -3802,6 +3802,8 @@ ext4_mb_new_inode_pa(struct ext4_allocation_context *ac) pa->pa_free = pa->pa_len; atomic_set(&pa->pa_count, 1); spin_lock_init(&pa->pa_lock); + INIT_LIST_HEAD(&pa->pa_inode_list); + INIT_LIST_HEAD(&pa->pa_group_list); pa->pa_deleted = 0; pa->pa_linear = 0; @@ -3860,6 +3862,7 @@ ext4_mb_new_group_pa(struct ext4_allocation_context *ac) atomic_set(&pa->pa_count, 1); spin_lock_init(&pa->pa_lock); INIT_LIST_HEAD(&pa->pa_inode_list); + INIT_LIST_HEAD(&pa->pa_group_list); pa->pa_deleted = 0; pa->pa_linear = 1;