2001-12-20 10:12:30

by Denis Vlasenko

[permalink] [raw]
Subject: [BUG] cramfs+initrd: BOOM! (Re: ramdisk corruption problems)

[fifth (!) attempt, previous mails did not show up on lkml]
[This msg definitely does not want to make it into the list :-)]

At last I have found one definite bug (maybe there are others).
I was unable to load a minix initrd on any 2.4.12+ kernel. 2.4.10 is fine.
Thanks to Mike Galbraith <[email protected]> who said that he can load
minix initrds and sent me both .config and initrd. I found out that with his
.config I indeed can load my initrd. After many recompilations and reboots
(binary search :-) it turned out that compiled-in support for cramfs caused
initrds to be corrupted.

[update since 3rd attempt to reach lkml]
I did some debugging in fs/cramfs/inode.c:cramfs_read_super()
If I plant immediate "return 0;" there initrd loads.
If I place "return 0;" after "set_blocksize(sb->s_dev, PAGE_CACHE_SIZE);"
- BOOM! Kernel panic. Restoring blocksize to 1024 prior to return does NOT
help.
[end update]

This is the diff between 'good' and 'bad' .config:

--- .config.good Tue Dec 18 22:21:20 2001
+++ .config.bad Tue Dec 18 22:21:10 2001
@@ -716,7 +716,7 @@
CONFIG_EFS_FS=m
# CONFIG_JFFS_FS is not set
# CONFIG_JFFS2_FS is not set
-# CONFIG_CRAMFS is not set
+CONFIG_CRAMFS=y
CONFIG_TMPFS=y
CONFIG_RAMFS=y
CONFIG_ISO9660_FS=y
@@ -767,7 +767,7 @@
# CONFIG_NCPFS_NLS is not set
# CONFIG_NCPFS_EXTRAS is not set
# CONFIG_ZISOFS_FS is not set
-# CONFIG_ZLIB_FS_INFLATE is not set
+CONFIG_ZLIB_FS_INFLATE=y

#
# Partition Types

See?
Hope this info is useful.
--
vda