Skip to content
Snippets Groups Projects
Commit 14e99751 authored by Andreas Dilger's avatar Andreas Dilger
Browse files

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
parent 31943781
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment