    Small patch to fail gracefully in the case of IO error during journal
    replay
diff -rup linux-2.4.7-pre9/fs/reiserfs/super.c linux-2.4.7-pre9.patched/fs/reiserfs/super.c
--- linux-2.4.7-pre9/fs/reiserfs/super.c	Wed Jul  4 13:45:55 2001
+++ linux-2.4.7-pre9.patched/fs/reiserfs/super.c	Fri Jul 20 15:29:30 2001
@@ -779,16 +779,23 @@ struct super_block * reiserfs_read_super
 
     if (!(s->s_flags & MS_RDONLY)) {
 	struct reiserfs_super_block * rs = SB_DISK_SUPER_BLOCK (s);
+	int old_magic;
+
+	old_magic = strncmp (rs->s_magic,  REISER2FS_SUPER_MAGIC_STRING, 
+			     strlen ( REISER2FS_SUPER_MAGIC_STRING));
+	if( old_magic && le16_to_cpu(rs->s_version) != 0 ) {
+	  dput(s->s_root) ;
+	  s->s_root = NULL ;
+	  reiserfs_warning("reiserfs: wrong version/magic combination in the super-block\n") ;
+	  goto error ;
+	}
 
 	journal_begin(&th, s, 1) ;
 	reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), 1) ;
 
 	rs->s_state = cpu_to_le16 (REISERFS_ERROR_FS);
 
-        if (strncmp (rs->s_magic,  REISER2FS_SUPER_MAGIC_STRING, 
-		     strlen ( REISER2FS_SUPER_MAGIC_STRING))) {
-	    if (le16_to_cpu(rs->s_version) != 0)
-		BUG ();
+        if ( old_magic ) {
 	    // filesystem created under 3.5.x found
 	    if (!old_format_only (s)) {
 		reiserfs_warning("reiserfs: converting 3.5.x filesystem to the new format\n") ;
Only in linux-2.4.7-pre9.patched/fs/reiserfs: super.c.orig
