Re: EXT2-fs: unsupported inode size: 0

Peter Moulder (reiter@netspace.net.au)
11 Dec 1998 10:20:45 +1100


Junichi Saito <j.saito@wanadoo.fr> writes:

> What can trigger these messages ? I have had ones so far only with this
> partition. How can I fix this ?
>
> EXT2-fs: unsupported inode size: 0
> mount: wrong fs type, bad option, bad superblock on
> /dev/ide/hd/c0b0t0u0p7, or too many mounted file systems
>
> The kernel is 2.1.131 + 'device fs' + 'e2compr'.

This is my fault.

In my last e2compr patch, I included what was supposed to be a
bug fix: I upped the filesystem revision to EXT2_DYNAMIC_REV when
someone ext2-compresses a file for the first time on that filesystem.
Unfortunately I didn't think to include code to fill in the other
fields only used by EXT2_DYNAMIC_REV-level filesystems.

The fix for your problem is two-fold. First, for the filesystem
affected (but no others), do:

dd if=/dev/zero of=/dev/ide/hd/c0b0t0u0p7 bs=4 count=1 seek=275 notrunc
^^^^^^^^^^^^^^^^^
(or whatever)

(I don't suppose any block devices do honour O_TRUNC, do they?)

This sets s_rev_level back to zero (EXT2_GOOD_OLD_REV). (This means
that the s_feature_incompat bit won't be honoured -- which is in fact
the right thing for anyone who knows what they're doing. Just be
careful if/when you use a kernel/e2fsprogs that doesn't support
e2compr 0.4+.)

Second, correct my error so that the problem never recurs, by applying
this to your kernel source:

*** linux-e2c0.4.26/fs/ext2/compress.c
--- linux/fs/ext2/compress.c
***************
*** 425,438 ****
inode->i_sb->u.ext2_sb.s_es->s_algorithm_usage_bitmap
|= cpu_to_le32(1 << alg);
} else {
! inode->i_sb->u.ext2_sb.s_es->s_algorithm_usage_bitmap
= cpu_to_le32(1 << alg);
inode->i_sb->u.ext2_sb.s_feature_incompat
|= EXT2_FEATURE_INCOMPAT_COMPRESSION;
! inode->i_sb->u.ext2_sb.s_es->s_feature_incompat
|= cpu_to_le32(EXT2_FEATURE_INCOMPAT_COMPRESSION);
! if (inode->i_sb->u.ext2_sb.s_es->s_rev_level < EXT2_DYNAMIC_REV)
! inode->i_sb->u.ext2_sb.s_es->s_rev_level = EXT2_DYNAMIC_REV;
}
mark_buffer_dirty(inode->i_sb->u.ext2_sb.s_sbh, 1);
}
--- 425,450 ----
inode->i_sb->u.ext2_sb.s_es->s_algorithm_usage_bitmap
|= cpu_to_le32(1 << alg);
} else {
! struct ext2_super_block *es = inode->i_sb->u.ext2_sb.s_es;
!
! es->s_algorithm_usage_bitmap
= cpu_to_le32(1 << alg);
inode->i_sb->u.ext2_sb.s_feature_incompat
|= EXT2_FEATURE_INCOMPAT_COMPRESSION;
! es->s_feature_incompat
|= cpu_to_le32(EXT2_FEATURE_INCOMPAT_COMPRESSION);
! if (es->s_rev_level < EXT2_DYNAMIC_REV) {
! /* Raise the filesystem revision level to
! EXT2_DYNAMIC_REV so that s_feature_incompat
! is honoured (except in ancient kernels /
! e2fsprogs). We must also initialize two
! other dynamic-rev fields. The remaining
! fields are assumed to be already correct
! (e.g. still zeroed). */
! es->s_rev_level = cpu_to_le32(EXT2_DYNAMIC_REV);
! es->s_first_ino = cpu_to_le32(EXT2_GOOD_OLD_FIRST_INO);
! es->s_inode_size = cpu_to_le32(EXT2_GOOD_OLD_INODE_SIZE);
! }
}
mark_buffer_dirty(inode->i_sb->u.ext2_sb.s_sbh, 1);
}

Does anyone have sources to a really old distribution of e2fsprogs?
If so, can you check that in lib/ext2fs/initialize.c, there's a line
`memset(super, 0, SUPERBLOCK_SIZE);' and that SUPERBLOCK_SIZE is
#defined as 1024 (in lib/ext2fs/ext2fs.h)? Thanks.

Let me know if anyone can see any other problem in the above.

pjm.

"We've upped our standards, so up yours."

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/