e2fsprogs-1.32 wrong exit code?

Greg Schafer gschafer at zip.com.au
Wed Mar 19 00:20:52 PST 2003


On Wed, Mar 19, 2003 at 12:14:12AM -0500, Archaic wrote:
> On Wed, Mar 05, 2003 at 11:32:13AM +0100, Stefan Krah wrote:
> > * Archaic <archaic at indy.rr.com> wrote:
> > > I've been noticing a problem lately with e2fsprogs. It only seems to
> > > happen with 1.32 and only on partitions created with 1.32. Whenever it
> > > optimizes directories (which seems to be the default with forced fsck's)
> > > it exits (presumably) with an error code between 3 and 15, which causes
> > > the checkfs script to poweroff the system. Upon restarting, everything
> > > is fine. I couldn't find anything in the tarball relating to this. Has
> > > anyone else seen this? I didn't see anything in the Sourceforge forum,
> > > so I thought I would start here.
> > 
> > I came across this thread, where someone had similar problems which
> > were solved by disabling HTREE:
> > 
> > http://www.uwsg.iu.edu/hypermail/linux/kernel/0211.0/1181.html
> > 
> > And all major distros seem to patch e2fsprogs-1.32 in order to
> > disable HTREE by default and that's the way it will be in the
> > next release:
> > 
> > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=181615
> > 
> > I don't know if this is related to your problem, but might be a good idea
> > to include the patch in the book. [crosspost and f'up to lfs.dev]
> 
> Yes, after checking the configure.in, HTREE is labeled experimental, yet
> also enabled by default. After reading the above mentioned thread, I
> concur that --disable-htree should be used in the book until the default
> behaviour is changed. Otherwise, reboots will be neccessary each time
> the directories are optimized. After grepping the e2fs docs, I find no
> mention of an HTREE option to mke2fs or fsck. It's automatically done if
> the partition was formatted with the 1.32 (maybe even 1.31 or 1.30) but
> not on partitions made with 1.29 or older.

After reading all the material, I'm not sure that --disable-htree is the
answer. It seems to me that the upstream patches as used by Debian are a
better solution.

This is probably a classic example of where the lfs-patches list or whatever
it was that was talked about a while back would come in handy. (Tushar?)

Attached is the relevant bits of patch. I've tested to make sure it builds
but the fact that Debian unstable has been running this code for a while
should ensure that the functionality is reasonably solid.

Greg
-------------- next part --------------
diff -uNr e2fsprogs-1.32.orig/e2fsck/ChangeLog e2fsprogs-1.32/e2fsck/ChangeLog
--- e2fsprogs-1.32.orig/e2fsck/ChangeLog	2002-11-10 07:01:02.000000000 +1100
+++ e2fsprogs-1.32/e2fsck/ChangeLog	2003-03-19 19:00:09.000000000 +1100
@@ -1,3 +1,9 @@
+2002-11-12  Theodore Ts'o  <tytso at mit.edu>
+
+	* problem.c: Make HTREE problems PR_PREEN_OK, so that we don't
+		abort an e2fsck after the filesystem has been mounted
+		using the 2.4 ext2 codebase.
+
 2002-11-09  Theodore Ts'o  <tytso at mit.edu>
 
 	* Release of E2fsprogs 1.32
diff -uNr e2fsprogs-1.32.orig/e2fsck/problem.c e2fsprogs-1.32/e2fsck/problem.c
--- e2fsprogs-1.32.orig/e2fsck/problem.c	2002-10-01 01:19:36.000000000 +1000
+++ e2fsprogs-1.32/e2fsck/problem.c	2003-03-19 19:00:09.000000000 +1100
@@ -671,32 +671,32 @@
 	/* INDEX_FL flag set on a non-HTREE filesystem */
 	{ PR_1_HTREE_SET,
 	  N_("@i %i has INDEX_FL flag set on @f without htree support.\n"),
-	  PROMPT_CLEAR_HTREE, 0 },
+	  PROMPT_CLEAR_HTREE, PR_PREEN_OK },
 
 	/* INDEX_FL flag set on a non-directory */	
 	{ PR_1_HTREE_NODIR,
 	  N_("@i %i has INDEX_FL flag set but is not a @d.\n"),
-	  PROMPT_CLEAR_HTREE, 0 },
+	  PROMPT_CLEAR_HTREE, PR_PREEN_OK },
 
 	/* Invalid root node in HTREE directory */	
 	{ PR_1_HTREE_BADROOT,
 	  N_("@h %i has an invalid root node.\n"),
-	  PROMPT_CLEAR_HTREE, 0 },
+	  PROMPT_CLEAR_HTREE, PR_PREEN_OK },
 
 	/* Unsupported hash version in HTREE directory */	
 	{ PR_1_HTREE_HASHV,
 	  N_("@h %i has an unsupported hash version (%N)\n"),
-	  PROMPT_CLEAR_HTREE, 0 },
+	  PROMPT_CLEAR_HTREE, PR_PREEN_OK },
 
 	/* Incompatible flag in HTREE root node */	
 	{ PR_1_HTREE_INCOMPAT,
 	  N_("@h %i uses an incompatible htree root node flag.\n"),
-	  PROMPT_CLEAR_HTREE, 0 },
+	  PROMPT_CLEAR_HTREE, PR_PREEN_OK },
 
 	/* HTREE too deep */	
 	{ PR_1_HTREE_DEPTH,
 	  N_("@h %i has a tree depth (%N) which is too big\n"),
-	  PROMPT_CLEAR_HTREE, 0 },
+	  PROMPT_CLEAR_HTREE, PR_PREEN_OK },
 		  
 	/* Pass 1b errors */
 
@@ -1065,22 +1065,22 @@
 	/* Invalid HTREE root node */
 	{ PR_2_HTREE_BAD_ROOT,
 	  N_("@p @h %d: root node is invalid\n"),
-	  PROMPT_CLEAR_HTREE, 0 },
+	  PROMPT_CLEAR_HTREE, PR_PREEN_OK },
 
 	/* Invalid HTREE limit */
 	{ PR_2_HTREE_BAD_LIMIT,
 	  N_("@p @h %d: node (%B) has bad limit (%N)\n"),
-	  PROMPT_CLEAR_HTREE, 0 },
+	  PROMPT_CLEAR_HTREE, PR_PREEN_OK },
 
 	/* Invalid HTREE count */
 	{ PR_2_HTREE_BAD_COUNT,
 	  N_("@p @h %d: node (%B) has bad count (%N)\n"),
-	  PROMPT_CLEAR_HTREE, 0 },
+	  PROMPT_CLEAR_HTREE, PR_PREEN_OK },
 
 	/* HTREE interior node has out-of-order hashes in table */
 	{ PR_2_HTREE_HASH_ORDER,
 	  N_("@p @h %d: node (%B) has an unordered hash table\n"),
-	  PROMPT_CLEAR_HTREE, 0 },
+	  PROMPT_CLEAR_HTREE, PR_PREEN_OK },
 
 	/* Node in HTREE directory has bad depth */
 	{ PR_2_HTREE_BAD_DEPTH,
diff -uNr e2fsprogs-1.32.orig/misc/ChangeLog e2fsprogs-1.32/misc/ChangeLog
--- e2fsprogs-1.32.orig/misc/ChangeLog	2002-11-10 07:01:02.000000000 +1100
+++ e2fsprogs-1.32/misc/ChangeLog	2003-03-19 19:00:09.000000000 +1100
@@ -1,3 +1,10 @@
+2002-11-12  Theodore Ts'o  <tytso at mit.edu>
+
+	* mke2fs.c (PRS): Don't enable the dir_index feature by default;
+		the ext2 code on 2.4 kernels (but not 2.2 kernels, and not
+		the 2.4 ext3 code) accidentally had the backwards
+		compatibility support for dir_indexing removed.
+
 2002-11-09  Theodore Ts'o  <tytso at mit.edu>
 
 	* Release of E2fsprogs 1.32
diff -uNr e2fsprogs-1.32.orig/misc/mke2fs.c e2fsprogs-1.32/misc/mke2fs.c
--- e2fsprogs-1.32.orig/misc/mke2fs.c	2002-10-31 19:49:21.000000000 +1100
+++ e2fsprogs-1.32/misc/mke2fs.c	2003-03-19 19:00:09.000000000 +1100
@@ -843,7 +843,9 @@
 	param.s_rev_level = 1;  /* Create revision 1 filesystems now */
 	param.s_feature_incompat |= EXT2_FEATURE_INCOMPAT_FILETYPE;
 	param.s_feature_ro_compat |= EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER;
+#if 0
 	param.s_feature_compat |= EXT2_FEATURE_COMPAT_DIR_INDEX;
+#endif
 
 #ifdef __linux__
 	if (uname(&ut)) {


More information about the lfs-dev mailing list