From a5ed9803a59e200c0e19f09050b137bd3f1aac4d Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 10 Jan 2008 22:05:07 +0000 Subject: [PATCH] Branch b1_4 b=14493 i=adilger i=johann Patch from bzzz. Kernel BUG at ... ldiskfs/ldiskfs/mballoc.c:3853 Removing the underlying device (e.g. via a SCSI rescan) can cause a kernel BUG in ldiskfs_mb_discard_inode_preallocations(). --- ldiskfs/ChangeLog | 6 ++++++ ldiskfs/kernel_patches/patches/ext3-mballoc3-core.patch | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ldiskfs/ChangeLog b/ldiskfs/ChangeLog index f2ccb58..b4a4e1f 100644 --- a/ldiskfs/ChangeLog +++ b/ldiskfs/ChangeLog @@ -1,6 +1,12 @@ tbd Sun Microsystems, Inc. * version 3.0.5 +Severity : normal +Bugzilla : 14493 +Description: Kernel BUG at ... ldiskfs/ldiskfs/mballoc.c:3853 +Details : Removing the underlying device (e.g. via a SCSI rescan) can cause a + kernel BUG in ldiskfs_mb_discard_inode_preallocations(). + -------------------------------------------------------------------------------- 2008-01-11 Sun Microsystems, Inc. diff --git a/ldiskfs/kernel_patches/patches/ext3-mballoc3-core.patch b/ldiskfs/kernel_patches/patches/ext3-mballoc3-core.patch index fca4db9..6f2cb7f 100644 --- a/ldiskfs/kernel_patches/patches/ext3-mballoc3-core.patch +++ b/ldiskfs/kernel_patches/patches/ext3-mballoc3-core.patch @@ -4030,15 +4030,15 @@ Index: linux-2.6.9-full/fs/ext3/mballoc.c + BUG_ON(err != 0); /* error handling here */ + + bitmap_bh = read_block_bitmap(sb, group); -+ if (bitmap_bh == NULL) { -+ /* error handling here */ -+ ext3_mb_release_desc(&e3b); -+ BUG_ON(bitmap_bh == NULL); -+ } + + ext3_lock_group(sb, group); + list_del_rcu(&pa->pa_group_list); -+ ext3_mb_release_inode_pa(&e3b, bitmap_bh, pa); ++ ++ /* can be NULL due to IO error, at worst ++ * we leave some free blocks unavailable ++ * do not go RO - no need for */ ++ if (bitmap_bh != NULL) ++ ext3_mb_release_inode_pa(&e3b, bitmap_bh, pa); + ext3_unlock_group(sb, group); + + ext3_mb_release_desc(&e3b); -- 1.8.3.1