[kernel/f16] Fix ext4 corrupted bitmap error path (pointed out by Eric Sandeen)

Josh Boyer jwboyer at fedoraproject.org
Tue Jan 10 19:14:15 UTC 2012


commit 61eda14a103d763cfc2b04e6612a84099b9abc95
Author: Josh Boyer <jwboyer at redhat.com>
Date:   Tue Jan 10 14:08:28 2012 -0500

    Fix ext4 corrupted bitmap error path (pointed out by Eric Sandeen)

 ...error-handling-on-inode-bitmap-corruption.patch |   19 +++++++++++++++++++
 kernel.spec                                        |    4 ++++
 2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/ext4-Fix-error-handling-on-inode-bitmap-corruption.patch b/ext4-Fix-error-handling-on-inode-bitmap-corruption.patch
new file mode 100644
index 0000000..e22a2b4
--- /dev/null
+++ b/ext4-Fix-error-handling-on-inode-bitmap-corruption.patch
@@ -0,0 +1,19 @@
+diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
+index 00beb4f..8fb6844 100644
+--- a/fs/ext4/ialloc.c
++++ b/fs/ext4/ialloc.c
+@@ -885,8 +885,12 @@ got:
+ 	if (IS_DIRSYNC(inode))
+ 		ext4_handle_sync(handle);
+ 	if (insert_inode_locked(inode) < 0) {
+-		err = -EINVAL;
+-		goto fail_drop;
++		/*
++		 * Likely a bitmap corruption causing inode to be allocated
++		 * twice.
++		 */
++		err = -EIO;
++		goto fail;
+ 	}
+ 	spin_lock(&sbi->s_next_gen_lock);
+ 	inode->i_generation = sbi->s_next_generation++;
diff --git a/kernel.spec b/kernel.spec
index fbbcd03..416476a 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -856,6 +856,7 @@ Patch21056: KVM-fix-device-assignment-permissions.patch
 Patch21065: Bluetooth-Add-support-for-BCM20702A0.patch
 
 Patch21070: ext4-Support-check-none-nocheck-mount-options.patch
+Patch21071: ext4-Fix-error-handling-on-inode-bitmap-corruption.patch
 
 # compat-wireless patches
 Patch50000: compat-wireless-config-fixups.patch
@@ -1601,6 +1602,8 @@ ApplyPatch msi-irq-sysfs-warning.patch
 
 ApplyPatch ext4-Support-check-none-nocheck-mount-options.patch
 
+ApplyPatch ext4-Fix-error-handling-on-inode-bitmap-corruption.patch
+
 # END OF PATCH APPLICATIONS
 
 %endif
@@ -2380,6 +2383,7 @@ fi
 %changelog
 * Tue Jan 10 2012 Josh Boyer <jwboyer at redhat.com>
 - Add patch to fix ext4 compatibility with ext2 mount option (rhbz 770172)
+- Fix ext4 corrupted bitmap error path (pointed out by Eric Sandeen)
 
 * Sat Jan 07 2012 Josh Boyer <jwboyer at redhat.com> 3.1.8-2
 - Add iwlwifi-allow-to-switch-to-HT40-if-not-associated.patch back to


More information about the scm-commits mailing list