diff -puN stage2/fsys_reiserfs.c~reiserfs-debug stage2/fsys_reiserfs.c --- grub-0.97/stage2/fsys_reiserfs.c~reiserfs-debug 2006-09-13 18:41:43.000000000 +0400 +++ grub-0.97-vs/stage2/fsys_reiserfs.c 2006-09-13 18:45:40.000000000 +0400 @@ -22,7 +22,7 @@ #include "shared.h" #include "filesys.h" -#undef REISERDEBUG +#define REISERDEBUG 1 /* Some parts of this code (mainly the structures and defines) are * from the original reiser fs code, as found in the linux kernel. @@ -664,6 +664,9 @@ reiserfs_mount (void) return 1; } +#define fs_corrupted() \ + printf("%s: %d: %s: fs inconsistency is found\n", __FILE__, __LINE__, __FUNCTION__) + /***************** TREE ACCESSING METHODS *****************************/ /* I assume you are familiar with the ReiserFS tree, if not go to @@ -713,6 +716,7 @@ read_tree_node (unsigned int blockNr, in /* Make sure it has the right node level */ if (BLOCKHEAD (cache)->blk_level != depth) { + fs_corrupted(); errnum = ERR_FSYS_CORRUPT; return 0; } @@ -878,6 +882,7 @@ search_stat (__u32 dir_id, __u32 objecti } ih++; } + fs_corrupted(); errnum = ERR_FSYS_CORRUPT; return 0; } @@ -1058,8 +1063,10 @@ reiserfs_dir (char *dirname) if (! next_key () || reiserfs_read (linkbuf, filemax) != filemax) { - if (! errnum) + if (! errnum) { + fs_corrupted(); errnum = ERR_FSYS_CORRUPT; + } return 0; } _