From 14e99751ccc114d0c64ecbd760d92e63f923f25e Mon Sep 17 00:00:00 2001
From: adilger <adilger>
Date: Tue, 25 Sep 2007 16:39:33 +0000
Subject: [PATCH] Branch b1_6 Description: e2fsck reports "invalid unused
 inodes count" Details    : If a new ldiskfs filesystem is created with the
 "uninit_groups" 	     feature and only a single inode is created in a
 group then the 	     "bg_unused_inodes" count is incorrectly updated. 
 Creating a 	     second inode in that group would update it correctly.
 i=behlendorf i=valerie

---
 ldiskfs/kernel_patches/patches/ext3-uninit-2.6-sles10.patch | 2 +-
 ldiskfs/kernel_patches/patches/ext3-uninit-2.6-suse.patch   | 2 +-
 ldiskfs/kernel_patches/patches/ext3-uninit-2.6.18.patch     | 2 +-
 ldiskfs/kernel_patches/patches/ext3-uninit-2.6.9.patch      | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ldiskfs/kernel_patches/patches/ext3-uninit-2.6-sles10.patch b/ldiskfs/kernel_patches/patches/ext3-uninit-2.6-sles10.patch
index 62b1f50a90..32a98105de 100644
--- a/ldiskfs/kernel_patches/patches/ext3-uninit-2.6-sles10.patch
+++ b/ldiskfs/kernel_patches/patches/ext3-uninit-2.6-sles10.patch
@@ -392,7 +392,7 @@ Index: linux-2.6.16.27-0.9-full/fs/ext3/ialloc.c
 +	if (EXT3_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) {
 +		if (gdp->bg_flags & cpu_to_le16(EXT3_BG_INODE_UNINIT)) {
 +			gdp->bg_flags &= cpu_to_le16(~EXT3_BG_INODE_UNINIT);
-+			free = EXT3_INODES_PER_GROUP(sb);
++			free = 0;
 +		} else {
 +			free = EXT3_INODES_PER_GROUP(sb) -
 +				le16_to_cpu(gdp->bg_itable_unused);
diff --git a/ldiskfs/kernel_patches/patches/ext3-uninit-2.6-suse.patch b/ldiskfs/kernel_patches/patches/ext3-uninit-2.6-suse.patch
index 8a34ea5afa..80bf99b88d 100644
--- a/ldiskfs/kernel_patches/patches/ext3-uninit-2.6-suse.patch
+++ b/ldiskfs/kernel_patches/patches/ext3-uninit-2.6-suse.patch
@@ -381,7 +381,7 @@ Index: linux-2.6.5-7.283-full/fs/ext3/ialloc.c
 +	if (EXT3_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) {
 +		if (gdp->bg_flags & cpu_to_le16(EXT3_BG_INODE_UNINIT)) {
 +			gdp->bg_flags &= cpu_to_le16(~EXT3_BG_INODE_UNINIT);
-+			free = EXT3_INODES_PER_GROUP(sb);
++			free = 0;
 +		} else {
 +			free = EXT3_INODES_PER_GROUP(sb) -
 +				le16_to_cpu(gdp->bg_itable_unused);
diff --git a/ldiskfs/kernel_patches/patches/ext3-uninit-2.6.18.patch b/ldiskfs/kernel_patches/patches/ext3-uninit-2.6.18.patch
index 906caf2243..8f1c07730d 100644
--- a/ldiskfs/kernel_patches/patches/ext3-uninit-2.6.18.patch
+++ b/ldiskfs/kernel_patches/patches/ext3-uninit-2.6.18.patch
@@ -393,7 +393,7 @@ Index: linux-rhel5/fs/ext3/ialloc.c
 +	if (EXT3_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) {
 +		if (gdp->bg_flags & cpu_to_le16(EXT3_BG_INODE_UNINIT)) {
 +			gdp->bg_flags &= cpu_to_le16(~EXT3_BG_INODE_UNINIT);
-+			free = EXT3_INODES_PER_GROUP(sb);
++			free = 0;
 +		} else {
 +			free = EXT3_INODES_PER_GROUP(sb) -
 +				le16_to_cpu(gdp->bg_itable_unused);
diff --git a/ldiskfs/kernel_patches/patches/ext3-uninit-2.6.9.patch b/ldiskfs/kernel_patches/patches/ext3-uninit-2.6.9.patch
index 2dbeb80a2b..b9566649d1 100644
--- a/ldiskfs/kernel_patches/patches/ext3-uninit-2.6.9.patch
+++ b/ldiskfs/kernel_patches/patches/ext3-uninit-2.6.9.patch
@@ -392,7 +392,7 @@ Index: linux-2.6.9-full/fs/ext3/ialloc.c
 +	if (EXT3_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) {
 +		if (gdp->bg_flags & cpu_to_le16(EXT3_BG_INODE_UNINIT)) {
 +			gdp->bg_flags &= cpu_to_le16(~EXT3_BG_INODE_UNINIT);
-+			free = EXT3_INODES_PER_GROUP(sb);
++			free = 0;
 +		} else {
 +			free = EXT3_INODES_PER_GROUP(sb) -
 +				le16_to_cpu(gdp->bg_itable_unused);
-- 
GitLab