From: Badari Pulavarty Alexey Dobriyan reported ext2 discard reservation panic while ago (http://lkml.org/lkml/2007/3/2/138). If ext2_new_inode() fails for any reason it would end up calling ext2_discard_reservation() (due to last iput). Normally, it does nothing since we don't have a reservation window structure allocated. But the NULL pointer check wouldn't work with slab poisioning, and causes oops. Fix is to initialize i_block_alloc_info to NULL in ext2_alloc_inode() code instead of assuming that it would be NULL. Same fix already exists in ext3 and ext4. Signed-off-by: Badari Pulavarty Cc: "Martin J. Bligh" Cc: Valerie Henson Cc: Mingming Cao Cc: Hugh Dickins Signed-off-by: Andrew Morton --- fs/ext2/super.c | 1 + 1 file changed, 1 insertion(+) diff -puN fs/ext2/super.c~fix-for-ext2-reservation fs/ext2/super.c --- a/fs/ext2/super.c~fix-for-ext2-reservation +++ a/fs/ext2/super.c @@ -149,6 +149,7 @@ static struct inode *ext2_alloc_inode(st ei->i_acl = EXT2_ACL_NOT_CACHED; ei->i_default_acl = EXT2_ACL_NOT_CACHED; #endif + ei->i_block_alloc_info = NULL; ei->vfs_inode.i_version = 1; return &ei->vfs_inode; } _