diff -rup linux-2.4.7-ac1/fs/reiserfs/bitmap.c linux-2.4.7-ac1.patched/fs/reiserfs/bitmap.c
--- linux-2.4.7-ac1/fs/reiserfs/bitmap.c	Fri Jul 27 22:16:49 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/bitmap.c	Fri Jul 27 22:22:27 2001
@@ -68,23 +68,6 @@ int is_reusable (struct super_block * s,
 
 #endif /* CONFIG_REISERFS_CHECK */
 
-#if 0
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-int is_used (struct super_block * s, unsigned long block)
-{
-    int i, j;
-
-    i = block / (s->s_blocksize << 3);
-    j = block % (s->s_blocksize << 3);
-    if (reiserfs_test_le_bit(j, SB_AP_BITMAP (s)[i]->b_data))
-	return 1;
-    return 0;
-  
-}
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#endif
-
-
 /* get address of corresponding bit (bitmap block number and offset in it) */
 static inline void get_bit_address (struct super_block * s, unsigned long block, int * bmap_nr, int * offset)
 {
@@ -109,13 +92,8 @@ void reiserfs_free_block (struct reiserf
     struct buffer_head ** apbh;
     int nr, offset;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (!s)
-	reiserfs_panic (s, "vs-4060: reiserfs_free_block: trying to free block on nonexistent device");
-
-    if (is_reusable (s, block, 1) == 0)
-	reiserfs_panic (s, "vs-4070: reiserfs_free_block: can not free such block");
-#endif
+  RFALSE(!s, "vs-4060: trying to free block on nonexistent device");
+  RFALSE(is_reusable (s, block, 1) == 0, "vs-4070: can not free such block");
 
   rs = SB_DISK_SUPER_BLOCK (s);
   sbh = SB_BUFFER_WITH_SB (s);
@@ -317,17 +295,12 @@ static int do_reiserfs_new_blocknrs (str
 	   priority 0 */
 	return NO_DISK_SPACE;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (!s)
-	reiserfs_panic (s, "vs-4090: reiserfs_new_blocknrs: trying to get new block from nonexistent device");
-    
-    if (search_start == MAX_B_NUM)
-	reiserfs_panic (s, "vs-4100: reiserfs_new_blocknrs: we are optimizing location based on "
-			"the bogus location of a temp buffer (%lu).", search_start);
-    
-    if (amount_needed < 1 || amount_needed > 2) 
-	reiserfs_panic (s, "vs-4110: reiserfs_new_blocknrs: amount_needed parameter incorrect (%d)", amount_needed);
-#endif /* CONFIG_REISERFS_CHECK */
+  RFALSE( !s, "vs-4090: trying to get new block from nonexistent device");
+  RFALSE( search_start == MAX_B_NUM,
+	  "vs-4100: we are optimizing location based on "
+	  "the bogus location of a temp buffer (%lu).", search_start);
+  RFALSE( amount_needed < 1 || amount_needed > 2,
+	  "vs-4110: amount_needed parameter incorrect (%d)", amount_needed);
 
   /* We continue the while loop if another process snatches our found
    * free block from us after we find it but before we successfully
@@ -337,10 +310,8 @@ static int do_reiserfs_new_blocknrs (str
   while (amount_needed--) {
     /* skip over any blocknrs already gotten last time. */
     if (*(free_blocknrs) != 0) {
-#ifdef CONFIG_REISERFS_CHECK
-      if (is_reusable (s, *free_blocknrs, 1) == 0)
-	reiserfs_panic(s, "vs-4120: reiserfs_new_blocknrs: bad blocknr on free_blocknrs list");
-#endif /* CONFIG_REISERFS_CHECK */
+      RFALSE( is_reusable (s, *free_blocknrs, 1) == 0, 
+	      "vs-4120: bad blocknr on free_blocknrs list");
       free_blocknrs++;
       continue;
     }
@@ -414,10 +385,9 @@ free_and_return:
 
     reiserfs_prepare_for_journal(s, SB_AP_BITMAP(s)[i], 1) ;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (buffer_locked (SB_AP_BITMAP (s)[i]) || is_reusable (s, search_start, 0) == 0)
-	reiserfs_panic (s, "vs-4140: reiserfs_new_blocknrs: bitmap block is locked or bad block number found");
-#endif
+    RFALSE( buffer_locked (SB_AP_BITMAP (s)[i]) || 
+	    is_reusable (s, search_start, 0) == 0,
+	    "vs-4140: bitmap block is locked or bad block number found");
 
     /* if this bit was already set, we've scheduled, and someone else
     ** has allocated it.  loop around and try again
diff -rup linux-2.4.7-ac1/fs/reiserfs/buffer2.c linux-2.4.7-ac1.patched/fs/reiserfs/buffer2.c
--- linux-2.4.7-ac1/fs/reiserfs/buffer2.c	Fri Jul 27 22:16:49 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/buffer2.c	Fri Jul 27 22:22:27 2001
@@ -109,11 +109,9 @@ static int get_new_buffer_near_blocknr(
   *pp_s_new_bh = reiserfs_getblk(p_s_sb->s_dev, n_new_blocknumber, p_s_sb->s_blocksize);
   if ( buffer_uptodate(*pp_s_new_bh) ) {
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( buffer_dirty(*pp_s_new_bh) || (*pp_s_new_bh)->b_dev == NODEV ) {
-      reiserfs_panic(p_s_sb, "PAP-14080: get_new_buffer: invalid uptodate buffer %b for the new block", *pp_s_new_bh);
-    }
-#endif
+    RFALSE( buffer_dirty(*pp_s_new_bh) || (*pp_s_new_bh)->b_dev == NODEV,
+	    "PAP-14080: invalid uptodate buffer %b for the new block", 
+	    *pp_s_new_bh);
 
     /* Free path buffers to prevent deadlock. */
     /* It is possible that this process has the buffer, which this function is getting, already in
@@ -158,12 +156,9 @@ static int get_new_buffer_near_blocknr(
   else {
     ;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (atomic_read (&((*pp_s_new_bh)->b_count)) != 1) {
-      reiserfs_panic(p_s_sb,"PAP-14100: get_new_buffer: not uptodate buffer %b for the new block has b_count more than one",
-		     *pp_s_new_bh);
-    }
-#endif
+    RFALSE( atomic_read (&((*pp_s_new_bh)->b_count)) != 1,
+	    "PAP-14100: not uptodate buffer %b for the new block has b_count more than one",
+	    *pp_s_new_bh);
 
   }
   return (n_ret_value | n_repeat);
@@ -310,12 +305,10 @@ int get_new_buffer(
     n_repeat |= SCHEDULE_OCCURRED;
   }
 
-#ifdef CONFIG_REISERFS_CHECK
-  if ( atomic_read (&((*pp_s_new_bh)->b_count)) != 1 || buffer_dirty (*pp_s_new_bh)) {
-    reiserfs_panic(p_s_sb,"PAP-14100: get_new_buffer: not free or dirty buffer %b for the new block",
-		   *pp_s_new_bh);
-  }
-#endif
+  RFALSE( atomic_read (&((*pp_s_new_bh)->b_count)) != 1 || 
+	  buffer_dirty (*pp_s_new_bh),
+	  "PAP-14100: not free or dirty buffer %b for the new block", 
+	  *pp_s_new_bh);
 
   return n_repeat;
 }
diff -rup linux-2.4.7-ac1/fs/reiserfs/dir.c linux-2.4.7-ac1.patched/fs/reiserfs/dir.c
--- linux-2.4.7-ac1/fs/reiserfs/dir.c	Fri Jul 27 22:16:49 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/dir.c	Fri Jul 27 22:22:27 2001
@@ -102,24 +102,18 @@ static int reiserfs_readdir (struct file
 	ih = de.de_ih;
 	store_ih (&tmp_ih, ih);
 		
-#ifdef CONFIG_REISERFS_CHECK
 	/* we must have found item, that is item of this directory, */
-	if (COMP_SHORT_KEYS (&(ih->ih_key), &pos_key))
-	    reiserfs_panic (inode->i_sb, "vs-9000: reiserfs_readdir: "
-			    "found item %h does not match to dir we readdir %k",
-			    ih, &pos_key);
-      
-	if (item_num > B_NR_ITEMS (bh) - 1)
-	    reiserfs_panic (inode->i_sb, "vs-9005: reiserfs_readdir: "
-			    "item_num == %d, item amount == %d",
-			    item_num, B_NR_ITEMS (bh));
+	RFALSE( COMP_SHORT_KEYS (&(ih->ih_key), &pos_key),
+		"vs-9000: found item %h does not match to dir we readdir %k",
+		ih, &pos_key);
+	RFALSE( item_num > B_NR_ITEMS (bh) - 1,
+		"vs-9005 item_num == %d, item amount == %d", 
+		item_num, B_NR_ITEMS (bh));
       
 	/* and entry must be not more than number of entries in the item */
-	if (I_ENTRY_COUNT (ih) < entry_num)
-	    reiserfs_panic (inode->i_sb, "vs-9010: reiserfs_readdir: "
-			    "entry number is too big %d (%d)",
-			    entry_num, I_ENTRY_COUNT (ih));
-#endif	/* CONFIG_REISERFS_CHECK */
+	RFALSE( I_ENTRY_COUNT (ih) < entry_num,
+		"vs-9010: entry number is too big %d (%d)", 
+		entry_num, I_ENTRY_COUNT (ih));
 
 	if (search_res == POSITION_FOUND || entry_num < I_ENTRY_COUNT (ih)) {
 	    /* go through all entries in the directory item beginning from the entry, that has been found */
diff -rup linux-2.4.7-ac1/fs/reiserfs/do_balan.c linux-2.4.7-ac1.patched/fs/reiserfs/do_balan.c
--- linux-2.4.7-ac1/fs/reiserfs/do_balan.c	Fri Jul 27 22:21:51 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/do_balan.c	Fri Jul 27 22:22:27 2001
@@ -90,18 +90,12 @@ static int balance_leaf_when_delete (str
     int n;
     struct item_head * ih;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( tb->FR[0] && B_LEVEL (tb->FR[0]) != DISK_LEAF_NODE_LEVEL + 1)
-	reiserfs_panic (tb->tb_sb,
-			"vs- 12000: balance_leaf_when_delete:level: wrong FR %z\n", tb->FR[0]);
-    if ( tb->blknum[0] > 1 )
-	reiserfs_panic (tb->tb_sb,
-			"PAP-12005: balance_leaf_when_delete: "
-			"tb->blknum == %d, can not be > 1", tb->blknum[0]);
-	
-    if ( ! tb->blknum[0] && ! PATH_H_PPARENT(tb->tb_path, 0))
-	reiserfs_panic (tb->tb_sb, "PAP-12010: balance_leaf_when_delete: tree can not be empty");
-#endif
+    RFALSE( tb->FR[0] && B_LEVEL (tb->FR[0]) != DISK_LEAF_NODE_LEVEL + 1,
+	    "vs- 12000: level: wrong FR %z\n", tb->FR[0]);
+    RFALSE( tb->blknum[0] > 1,
+	    "PAP-12005: tb->blknum == %d, can not be > 1", tb->blknum[0]);
+    RFALSE( ! tb->blknum[0] && ! PATH_H_PPARENT(tb->tb_path, 0),
+	    "PAP-12010: tree can not be empty");
 
     ih = B_N_PITEM_HEAD (tbS0, item_pos);
 
@@ -110,10 +104,9 @@ static int balance_leaf_when_delete (str
     switch (flag) {
     case M_DELETE:   /* delete item in S[0] */
 
-#ifdef CONFIG_REISERFS_CHECK
-	if (le16_to_cpu (ih->ih_item_len) + IH_SIZE != -tb->insert_size [0])
-	    reiserfs_panic (tb->tb_sb, "vs-12013: balance_leaf_when_delete: "
-			    "mode Delete, insert size %d, ih to be deleted %h", ih);
+	 RFALSE( le16_to_cpu (ih->ih_item_len) + IH_SIZE != -tb->insert_size [0],
+		 "vs-12013: mode Delete, insert size %d, ih to be deleted %h", 
+		 ih);
 
 #if 0 /* rigth delim key not supported */
 	if ( ! item_pos && (! tb->L[0] || COMP_KEYS(B_PRIGHT_DELIM_KEY(tb->L[0]), B_N_PKEY(tbS0, 0))) ) {
@@ -126,8 +119,6 @@ static int balance_leaf_when_delete (str
 	}
 #endif
 
-#endif
-
 	bi.tb = tb;
 	bi.bi_bh = tbS0;
 	bi.bi_parent = PATH_H_PPARENT (tb->tb_path, 0);
@@ -152,13 +143,8 @@ static int balance_leaf_when_delete (str
 	    }
 	} 
 
-#ifdef CONFIG_REISERFS_CHECK
-#if 0
-	if (! item_pos && (!tb->CFL[0] || !tb->L[0]))
-#endif
-	    if (! item_pos && !tb->CFL[0])
-		reiserfs_panic (tb->tb_sb, "PAP-12020: balance_leaf_when_delete: tb->CFL[0]==%p, tb->L[0]==%p", tb->CFL[0], tb->L[0]);
-#endif
+	RFALSE( ! item_pos && !tb->CFL[0],
+		"PAP-12020: tb->CFL[0]==%p, tb->L[0]==%p", tb->CFL[0], tb->L[0]);
     
 	break;
 
@@ -182,10 +168,9 @@ static int balance_leaf_when_delete (str
 	    tb->insert_size[0] = -1;
 	    leaf_cut_from_buffer (&bi, item_pos, pos_in_item, -tb->insert_size[0]);
 
-#ifdef CONFIG_REISERFS_CHECK
-	    if (! item_pos && ! pos_in_item && ! tb->CFL[0])
-		reiserfs_panic (tb->tb_sb, "PAP-12030: balance_leaf_when_delete: can not change delimiting key. CFL[0]=%p", tb->CFL[0]);
-#endif /* CONFIG_REISERFS_CHECK */
+	    RFALSE( ! item_pos && ! pos_in_item && ! tb->CFL[0],
+		    "PAP-12030: can not change delimiting key. CFL[0]=%p", 
+		    tb->CFL[0]);
 
 	    if ( ! item_pos && ! pos_in_item && tb->CFL[0] ) {
 		replace_key(tb, tb->CFL[0],tb->lkey[0],tbS0,0);
@@ -197,10 +182,8 @@ static int balance_leaf_when_delete (str
 	} else {
 	    leaf_cut_from_buffer (&bi, item_pos, pos_in_item, -tb->insert_size[0]);
 
-#ifdef CONFIG_REISERFS_CHECK
-	    if (! ih->ih_item_len)
-		reiserfs_panic (tb->tb_sb, "PAP-12035: balance_leaf_when_delete: cut must leave non-zero dynamic length of item");
-#endif /* CONFIG_REISERFS_CHECK */
+	    RFALSE( ! ih->ih_item_len,
+		    "PAP-12035: cut must leave non-zero dynamic length of item");
 	}
 	break;
     }
@@ -259,12 +242,8 @@ static int balance_leaf_when_delete (str
 		return -1;
 	    }
 
-#ifdef CONFIG_REISERFS_CHECK
-	    if ( tb->rnum[0] != 0 )
-		reiserfs_panic (tb->tb_sb, "PAP-12045: balance_leaf_when_delete: "
-				"rnum must be 0 (%d)", tb->rnum[0]);
-#endif /* CONFIG_REISERFS_CHECK */
-
+	    RFALSE( tb->rnum[0] != 0, 
+		    "PAP-12045: rnum must be 0 (%d)", tb->rnum[0]);
 	    /* all contents of L[0] and S[0] will be in L[0] */
 	    leaf_shift_left(tb, n, -1);
 
@@ -277,21 +256,18 @@ static int balance_leaf_when_delete (str
 	}
 	/* a part of contents of S[0] will be in L[0] and the rest part of S[0] will be in R[0] */
 
-#ifdef CONFIG_REISERFS_CHECK
-	if (( tb->lnum[0] + tb->rnum[0] < n ) || ( tb->lnum[0] + tb->rnum[0] > n+1 ))
-	    reiserfs_panic (tb->tb_sb, "PAP-12050: balance_leaf_when_delete: "
-			    "rnum(%d) and lnum(%d) and item number in S[0] are not consistent",
-			    tb->rnum[0], tb->lnum[0], n);
-
-	if (( tb->lnum[0] + tb->rnum[0] == n ) && (tb->lbytes != -1 || tb->rbytes != -1))
-	    reiserfs_panic (tb->tb_sb, "PAP-12055: balance_leaf_when_delete: "
-			    "bad rbytes (%d)/lbytes (%d) parameters when items are not split", 
-			    tb->rbytes, tb->lbytes);
-	if (( tb->lnum[0] + tb->rnum[0] == n + 1 ) && (tb->lbytes < 1 || tb->rbytes != -1))
-	    reiserfs_panic (tb->tb_sb, "PAP-12060: balance_leaf_when_delete: "
-			    "bad rbytes (%d)/lbytes (%d) parameters when items are split", 
-			    tb->rbytes, tb->lbytes);
-#endif
+	RFALSE( ( tb->lnum[0] + tb->rnum[0] < n ) || 
+		( tb->lnum[0] + tb->rnum[0] > n+1 ),
+		"PAP-12050: rnum(%d) and lnum(%d) and item number(%d) in S[0] are not consistent",
+		tb->rnum[0], tb->lnum[0], n);
+	RFALSE( ( tb->lnum[0] + tb->rnum[0] == n ) && 
+		(tb->lbytes != -1 || tb->rbytes != -1),
+		"PAP-12055: bad rbytes (%d)/lbytes (%d) parameters when items are not split", 
+		tb->rbytes, tb->lbytes);
+	RFALSE( ( tb->lnum[0] + tb->rnum[0] == n + 1 ) && 
+		(tb->lbytes < 1 || tb->rbytes != -1),
+		"PAP-12060: bad rbytes (%d)/lbytes (%d) parameters when items are split", 
+		tb->rbytes, tb->lbytes);
 
 	leaf_shift_left (tb, tb->lnum[0], tb->lbytes);
 	leaf_shift_right(tb, tb->rnum[0], tb->rbytes);
@@ -315,12 +291,8 @@ static int balance_leaf_when_delete (str
 	return 0;
     }
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( tb->rnum[0] )
-	reiserfs_panic (tb->tb_sb, "PAP-12065: balance_leaf_when_delete: "
-			"bad rnum parameter must be 0 (%d)", tb->rnum[0]);
-#endif
-
+    RFALSE( tb->rnum[0], 
+	    "PAP-12065: bad rnum parameter must be 0 (%d)", tb->rnum[0]);
     return 0;
 }
 
@@ -394,11 +366,8 @@ static int balance_leaf (struct tree_bal
 		    int new_item_len;
 		    int version;
 
-#ifdef CONFIG_REISERFS_CHECK
-		    if (!is_direct_le_ih (ih))
-			reiserfs_panic (tb->tb_sb, "PAP-12075: balance_leaf: " 
-					"only direct inserted item can be broken. %h", ih);
-#endif
+		    RFALSE( !is_direct_le_ih (ih),
+			    "PAP-12075: only direct inserted item can be broken. %h", ih);
 		    ret_val = leaf_shift_left (tb, tb->lnum[0]-1, -1);
 		    /* when reading the if conditions preceding the subsequent preserve_shifted
 		       lines understand that their goal is to determine if all that we are
@@ -415,12 +384,9 @@ static int balance_leaf (struct tree_bal
 		    /* Calculate and check item length to insert to L[0] */
 		    ih->ih_item_len -= new_item_len;
 
-#ifdef CONFIG_REISERFS_CHECK
-		    if ( (int)(ih->ih_item_len) <= 0 )
-			reiserfs_panic(tb->tb_sb, "PAP-12080: balance_leaf: "
-				       "there is nothing to insert into L[0]: ih_item_len=%d",
-				       (int)ih->ih_item_len);
-#endif
+		    RFALSE( (int)(ih->ih_item_len) <= 0,
+			    "PAP-12080: there is nothing to insert into L[0]: ih_item_len=%d",
+			    (int)ih->ih_item_len);
 
 		    /* Insert new item into L[0] */
 		    bi.tb = tb;
@@ -443,12 +409,9 @@ static int balance_leaf (struct tree_bal
 		    else
 			zeros_num -= tb->lbytes;
 
-#ifdef CONFIG_REISERFS_CHECK
-		    if ( (int)(ih->ih_item_len) <= 0 )
-			reiserfs_panic(tb->tb_sb, "PAP-12085: balance_leaf: "
-				       "there is nothing to insert into S[0]: ih_item_len=%d",
-				       (int)ih->ih_item_len);
-#endif
+		    RFALSE( (int)(ih->ih_item_len) <= 0,
+			    "PAP-12085: there is nothing to insert into S[0]: ih_item_len=%d",
+			    (int)ih->ih_item_len);
 		} else {
 		    /* new item in whole falls into L[0] */
 		    /* Shift lnum[0]-1 items to L[0] */
@@ -481,11 +444,8 @@ static int balance_leaf (struct tree_bal
 		    /* we must shift the part of the appended item */
 		    if ( is_direntry_le_ih (B_N_PITEM_HEAD (tbS0, item_pos))) {
 
-#ifdef CONFIG_REISERFS_CHECK
-			if ( zeros_num )
-			    reiserfs_panic(tb->tb_sb, "PAP-12090: balance_leaf: illegal parameter in case of a directory");
-#endif
-            
+			RFALSE( zeros_num,
+				"PAP-12090: illegal parameter in case of a directory");
 			/* directory item */
 			if ( tb->lbytes > pos_in_item ) {
 			    /* new directory entry falls into L[0] */
@@ -535,18 +495,12 @@ static int balance_leaf (struct tree_bal
 		    }
 		    else {
 			/* regular object */
-
-#ifdef CONFIG_REISERFS_CHECK
-			if ( tb->lbytes  <= 0 )
-			    reiserfs_panic(tb->tb_sb, "PAP-12095: balance_leaf: " 
-					   "there is nothing to shift to L[0]. lbytes=%d",
-					   tb->lbytes);
-			if ( pos_in_item != B_N_PITEM_HEAD(tbS0, item_pos)->ih_item_len )
-			    reiserfs_panic(tb->tb_sb, "PAP-12100: balance_leaf: " 
-					   "incorrect position to paste: item_len=%d, pos_in_item=%d",
-					   B_N_PITEM_HEAD(tbS0,item_pos)->ih_item_len, pos_in_item);
-#endif
-
+			RFALSE( tb->lbytes <= 0,
+				"PAP-12095: there is nothing to shift to L[0]. lbytes=%d",
+				tb->lbytes);
+			RFALSE( pos_in_item != B_N_PITEM_HEAD(tbS0, item_pos)->ih_item_len,
+				"PAP-12100: incorrect position to paste: item_len=%d, pos_in_item=%d",
+				B_N_PITEM_HEAD(tbS0,item_pos)->ih_item_len, pos_in_item);
 			if ( tb->lbytes >= pos_in_item ) {
 			    /* appended item will be in L[0] in whole */
 			    int l_n;
@@ -557,13 +511,9 @@ static int balance_leaf (struct tree_bal
 			    /* Calculate new insert_size[0] */
 			    tb->insert_size[0] -= l_n;
 
-#ifdef CONFIG_REISERFS_CHECK
-			    if ( tb->insert_size[0] <= 0 )
-				reiserfs_panic(tb->tb_sb, "PAP-12105: balance_leaf: " 
-					       "there is nothing to paste into L[0]. insert_size=%d",
-					       tb->insert_size[0]);
-#endif
-
+			    RFALSE( tb->insert_size[0] <= 0,
+				    "PAP-12105: there is nothing to paste into L[0]. insert_size=%d",
+				    tb->insert_size[0]);
 			    ret_val =  leaf_shift_left(tb,tb->lnum[0], 
 						       B_N_PITEM_HEAD(tbS0,item_pos)->ih_item_len);
 #if 0/*preserve list*/
@@ -581,12 +531,11 @@ static int balance_leaf (struct tree_bal
 				l_n,body, zeros_num > l_n ? l_n : zeros_num
 				);
 
-#ifdef CONFIG_REISERFS_CHECK
-			    if (l_n && is_indirect_le_ih(B_N_PITEM_HEAD(tb->L[0],
-									n + item_pos - ret_val)))
-				reiserfs_panic(tb->tb_sb, "PAP-12110: balance_leaf: "
-					       "pasting more than 1 unformatted node pointer into indirect item");
-#endif
+			    RFALSE( l_n && 
+				    is_indirect_le_ih(B_N_PITEM_HEAD
+						      (tb->L[0],
+						       n + item_pos - ret_val)),
+				    "PAP-12110: pasting more than 1 unformatted node pointer into indirect item");
 
 			    /* 0-th item in S0 can be only of DIRECT type when l_n != 0*/
 			    {
@@ -598,18 +547,10 @@ static int balance_leaf (struct tree_bal
 			      set_le_key_k_offset (version, B_N_PDELIM_KEY(tb->CFL[0],tb->lkey[0]),
 						   le_key_k_offset (version, B_N_PDELIM_KEY(tb->CFL[0],tb->lkey[0])) + l_n);
 			    }
-#if 0
-			    set_le_key_k_offset (B_PRIGHT_DELIM_KEY(tb->L[0]), le_key_k_offset (B_PRIGHT_DELIM_KEY(tb->L[0])) + l_n);
-#endif
 			    /*    k_offset (B_N_PKEY (tbS0, 0)) += l_n;
 				  k_offset (B_N_PDELIM_KEY(tb->CFL[0],tb->lkey[0])) += l_n;
 				  k_offset (B_PRIGHT_DELIM_KEY(tb->L[0])) += l_n;*/
 
-#ifdef NO_CONFIG_REISERFS_CHECK /* journal victim */
-			    if (!buffer_dirty (tbS0) || !buffer_dirty (tb->CFL[0]) || !buffer_dirty (tb->L[0]))
-				reiserfs_panic(tb->tb_sb, "PAP-12115: balance_leaf: L, CLF and S must be dirty already");
-#endif
-
 			    /* Calculate new body, position in item and insert_size[0] */
 			    if ( l_n > zeros_num ) {
 				body += (l_n - zeros_num);
@@ -619,26 +560,24 @@ static int balance_leaf (struct tree_bal
 				zeros_num -= l_n;
 			    pos_in_item = 0;	
 
-#ifdef CONFIG_REISERFS_CHECK	
-			    if (comp_short_le_keys (B_N_PKEY(tbS0,0),
-						    B_N_PKEY(tb->L[0],B_NR_ITEMS(tb->L[0])-1)) ||
-				!op_is_left_mergeable (B_N_PKEY (tbS0, 0), tbS0->b_size) ||
-				!op_is_left_mergeable(B_N_PDELIM_KEY(tb->CFL[0],tb->lkey[0]), tbS0->b_size))
-				reiserfs_panic (tb->tb_sb, "PAP-12120: balance_leaf: "
-						"item must be merge-able with left neighboring item");
-#endif
-
+			    RFALSE( comp_short_le_keys 
+				    (B_N_PKEY(tbS0,0),
+				     B_N_PKEY(tb->L[0],B_NR_ITEMS(tb->L[0])-1)) ||
+				
+				    !op_is_left_mergeable 
+				    (B_N_PKEY (tbS0, 0), tbS0->b_size) ||
+				    !op_is_left_mergeable
+				    (B_N_PDELIM_KEY(tb->CFL[0],tb->lkey[0]), 
+				     tbS0->b_size),
+				    "PAP-12120: item must be merge-able with left neighboring item");
 			}
 			else /* only part of the appended item will be in L[0] */
 			{
 			    /* Calculate position in item for append in S[0] */
 			    pos_in_item -= tb->lbytes;
 
-#ifdef CONFIG_REISERFS_CHECK
-			    if ( pos_in_item <= 0 )
-				reiserfs_panic(tb->tb_sb, "PAP-12125: balance_leaf: "
-					       "no place for paste. pos_in_item=%d", pos_in_item);
-#endif
+			    RFALSE( pos_in_item <= 0,
+				    "PAP-12125: no place for paste. pos_in_item=%d", pos_in_item);
 
 			    /* Shift lnum[0] - 1 items in whole. Shift lbytes - 1 byte from item number lnum[0] */
 			    leaf_shift_left(tb,tb->lnum[0],tb->lbytes);
@@ -723,11 +662,9 @@ static int balance_leaf (struct tree_bal
 		    int version;
 		    loff_t offset;
 
-#ifdef CONFIG_REISERFS_CHECK
-		    if ( !is_direct_le_ih (ih) )
-			reiserfs_panic(tb->tb_sb, "PAP-12135: balance_leaf: "
-				       "only direct item can be split. (%h)", ih);
-#endif
+		    RFALSE( !is_direct_le_ih (ih),
+			    "PAP-12135: only direct item can be split. (%h)", 
+			    ih);
 
 		    leaf_shift_right(tb,tb->rnum[0]-1,-1);
 #if 0/*preserve list*/
@@ -828,24 +765,18 @@ static int balance_leaf (struct tree_bal
 		    { /* we append to directory item */
 			int entry_count;
 
-#ifdef CONFIG_REISERFS_CHECK
-			if ( zeros_num )
-			    reiserfs_panic(tb->tb_sb, "PAP-12145: balance_leaf: illegal parametr in case of a directory");
-#endif
-
+			RFALSE( zeros_num,
+				"PAP-12145: illegal parametr in case of a directory");
 			entry_count = I_ENTRY_COUNT(B_N_PITEM_HEAD(tbS0, item_pos));
 			if ( entry_count - tb->rbytes < pos_in_item )
 			    /* new directory entry falls into R[0] */
 			{
 			    int paste_entry_position;
 
-#ifdef CONFIG_REISERFS_CHECK
-			    if ( tb->rbytes - 1 >= entry_count || ! tb->insert_size[0] )
-				reiserfs_panic(tb->tb_sb, "PAP-12150: balance_leaf: "
-					       "no enough of entries to shift to R[0]: rbytes=%d, entry_count=%d",
-					       tb->rbytes, entry_count);
-#endif
-
+			    RFALSE( tb->rbytes - 1 >= entry_count || 
+				    ! tb->insert_size[0],
+				    "PAP-12150: no enough of entries to shift to R[0]: rbytes=%d, entry_count=%d",
+				    tb->rbytes, entry_count);
 			    /* Shift rnum[0]-1 items in whole. Shift rbytes-1 directory entries from directory item number rnum[0] */
 			    leaf_shift_right(tb,tb->rnum[0],tb->rbytes - 1);
 #if 0/*preserve list*/
@@ -899,11 +830,9 @@ static int balance_leaf (struct tree_bal
 			if ( (n_shift = tb->rbytes - tb->insert_size[0]) < 0 )
 			    n_shift = 0;
 
-#ifdef CONFIG_REISERFS_CHECK
-			if (pos_in_item != B_N_PITEM_HEAD (tbS0, item_pos)->ih_item_len)
-			    reiserfs_panic(tb->tb_sb,"PAP-12155: balance_leaf: invalid position to paste. ih_item_len=%d, pos_in_item=%d",
-					   pos_in_item, B_N_PITEM_HEAD(tbS0,item_pos)->ih_item_len);
-#endif
+			RFALSE( pos_in_item != B_N_PITEM_HEAD (tbS0, item_pos)->ih_item_len,
+				"PAP-12155: invalid position to paste. ih_item_len=%d, pos_in_item=%d",
+				pos_in_item, B_N_PITEM_HEAD(tbS0,item_pos)->ih_item_len);
 
 			leaf_shift_right(tb,tb->rnum[0],n_shift);
 #if 0/*preserve list*/
@@ -954,10 +883,8 @@ static int balance_leaf (struct tree_bal
 
 			if (is_indirect_le_ih (B_N_PITEM_HEAD(tb->R[0],0))) {
 
-#ifdef CONFIG_REISERFS_CHECK
-			    if (n_rem)
-				reiserfs_panic(tb->tb_sb, "PAP-12160: balance_leaf: paste more than one unformatted node pointer");
-#endif
+			    RFALSE( n_rem,
+				    "PAP-12160: paste more than one unformatted node pointer");
 
 			    set_ih_free_space (B_N_PITEM_HEAD(tb->R[0],0), ((struct unfm_nodeinfo*)body)->unfm_freespace);
 			}
@@ -995,11 +922,8 @@ static int balance_leaf (struct tree_bal
 			    );
 			if ( ! pos_in_item ) {
 
-#ifdef CONFIG_REISERFS_CHECK
-			    if ( item_pos - n + tb->rnum[0] )
-				reiserfs_panic (tb->tb_sb, "PAP-12165: balance_leaf: " 
-						"directory item must be first item of node when pasting is in 0th position");
-#endif
+			    RFALSE( item_pos - n + tb->rnum[0],
+				    "PAP-12165: directory item must be first item of node when pasting is in 0th position");
 
 			    /* update delimiting keys */
 			    replace_key(tb, tb->CFR[0],tb->rkey[0],tb->R[0],0);
@@ -1032,43 +956,18 @@ static int balance_leaf (struct tree_bal
     }	/* tb->rnum[0] > 0 */
 
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( tb->blknum[0] > 3 )  
-	reiserfs_panic (tb->tb_sb, "PAP-12180: balance_leaf: blknum can not be %d. It must be <= 3",  tb->blknum[0]);
-
-    if ( tb->blknum[0] < 0 )  
-	reiserfs_panic (tb->tb_sb, "PAP-12185: balance_leaf: blknum can not be %d. It must be >= 0",  tb->blknum[0]);
-#endif
+    RFALSE( tb->blknum[0] > 3,
+	    "PAP-12180: blknum can not be %d. It must be <= 3",  tb->blknum[0]);
+    RFALSE( tb->blknum[0] < 0,
+	    "PAP-12185: blknum can not be %d. It must be >= 0",  tb->blknum[0]);
 
     /* if while adding to a node we discover that it is possible to split
        it in two, and merge the left part into the left neighbor and the
        right part into the right neighbor, eliminating the node */
     if ( tb->blknum[0] == 0 ) { /* node S[0] is empty now */
 
-#ifdef CONFIG_REISERFS_CHECK
-	if ( ! tb->lnum[0] || ! tb->rnum[0] )
-	    reiserfs_panic(tb->tb_sb, "PAP-12190: balance_leaf: lnum and rnum must not be zero");
-#if 0
-	if (COMP_KEYS (B_N_PKEY(tb->R[0], 0), B_PRIGHT_DELIM_KEY(tbS0)))
-	    reiserfs_panic (tb->tb_sb, "vs-12192: balance_leaf: S[0] is being removed from the tree, it has incorrect right delimiting key");
-#endif
-#endif
-
-#if 0
-	/* if insertion was done before 0-th position in R[0], right
-	   delimiting key of the tb->L[0]'s and left delimiting key are
-	   not set correctly */
-	if (tb->L[0]) {
-	    copy_key(B_PRIGHT_DELIM_KEY(tb->L[0]), B_PRIGHT_DELIM_KEY(tbS0));
-	    reiserfs_mark_buffer_dirty (tb->L[0], 0);
-	}
-
-	if (tb->CFL[0]) {
-	    copy_key (B_N_PDELIM_KEY (tb->CFL[0], tb->lkey[0]), B_PRIGHT_DELIM_KEY(tbS0));
-	    reiserfs_mark_buffer_dirty (tb->CFL[0], 0);
-	}
-#endif
-    
+	RFALSE( ! tb->lnum[0] || ! tb->rnum[0],
+		"PAP-12190: lnum and rnum must not be zero");
 	/* if insertion was done before 0-th position in R[0], right
 	   delimiting key of the tb->L[0]'s and left delimiting key are
 	   not set correctly */
@@ -1094,10 +993,7 @@ static int balance_leaf (struct tree_bal
     sbytes[1] = tb->s2bytes;
     for( i = tb->blknum[0] - 2; i >= 0; i-- ) {
 
-#ifdef CONFIG_REISERFS_CHECK
-	if (!snum[i])
-	    reiserfs_panic(tb->tb_sb,"PAP-12200: balance_leaf: snum[%d] == %d. Must be > 0", i, snum[i]);
-#endif /* CONFIG_REISERFS_CHECK */
+	RFALSE( !snum[i], "PAP-12200: snum[%d] == %d. Must be > 0", i, snum[i]);
 
 	/* here we shift from S to S_new nodes */
 
@@ -1120,14 +1016,11 @@ static int balance_leaf (struct tree_bal
 		    const char * r_body;
 		    int version;
 
-#ifdef CONFIG_REISERFS_CHECK
-		    if ( !is_direct_le_ih(ih) )
+		    RFALSE( !is_direct_le_ih(ih),
 			/* The items which can be inserted are:
 			   Stat_data item, direct item, indirect item and directory item which consist of only two entries "." and "..".
 			   These items must not be broken except for a direct one. */
-			reiserfs_panic(tb->tb_sb, "PAP-12205: balance_leaf: "
-				       "non-direct item can not be broken when inserting");
-#endif
+			    "PAP-12205: non-direct item can not be broken when inserting");
 
 		    /* Move snum[i]-1 items from S[0] to S_new[i] */
 		    leaf_move_items (LEAF_FROM_S_TO_SNEW, tb, snum[i] - 1, -1, S_new[i]);
@@ -1210,10 +1103,7 @@ static int balance_leaf (struct tree_bal
 		{ /* we must shift part of the appended item */
 		    struct item_head * aux_ih;
 
-#ifdef CONFIG_REISERFS_CHECK
-		    if ( ih )
-			reiserfs_panic (tb->tb_sb, "PAP-12210: balance_leaf: ih must be 0");
-#endif /* CONFIG_REISERFS_CHECK */
+		    RFALSE( ih, "PAP-12210: ih must be 0");
 
 		    if ( is_direntry_le_ih (aux_ih = B_N_PITEM_HEAD(tbS0,item_pos))) {
 			/* we append to directory item */
@@ -1225,14 +1115,11 @@ static int balance_leaf (struct tree_bal
 			if ( entry_count - sbytes[i] < pos_in_item  && pos_in_item <= entry_count ) {
 			    /* new directory entry falls into S_new[i] */
 		  
-#ifdef CONFIG_REISERFS_CHECK
-			    if ( ! tb->insert_size[0] )
-				reiserfs_panic (tb->tb_sb, "PAP-12215: balance_leaif: insert_size is already 0");
-			    if ( sbytes[i] - 1 >= entry_count )
-				reiserfs_panic (tb->tb_sb, "PAP-12220: balance_leaf: "
-						"there are no so much entries (%d), only %d",
-						sbytes[i] - 1, entry_count);
-#endif
+			    RFALSE( ! tb->insert_size[0],
+				    "PAP-12215: insert_size is already 0");
+			    RFALSE( sbytes[i] - 1 >= entry_count,
+				    "PAP-12220: there are no so much entries (%d), only %d",
+				    sbytes[i] - 1, entry_count);
 
 			    /* Shift snum[i]-1 items in whole. Shift sbytes[i] directory entries from directory item number snum[i] */
 			    leaf_move_items (LEAF_FROM_S_TO_SNEW, tb, snum[i], sbytes[i]-1, S_new[i]);
@@ -1268,11 +1155,9 @@ static int balance_leaf (struct tree_bal
 			int n_shift, n_rem, r_zeros_number;
 			const char * r_body;
 
-#ifdef CONFIG_REISERFS_CHECK
-			if ( pos_in_item != B_N_PITEM_HEAD(tbS0,item_pos)->ih_item_len ||
-			     tb->insert_size[0] <= 0 )
-			    reiserfs_panic (tb->tb_sb, "PAP-12225: balance_leaf: item too short or insert_size <= 0");
-#endif
+			RFALSE( pos_in_item != B_N_PITEM_HEAD(tbS0,item_pos)->ih_item_len ||
+				tb->insert_size[0] <= 0,
+				"PAP-12225: item too short or insert_size <= 0");
 
 			/* Calculate number of bytes which must be shifted from appended item */
 			n_shift = sbytes[i] - tb->insert_size[0];
@@ -1340,12 +1225,9 @@ static int balance_leaf (struct tree_bal
 		    tbS0 = PATH_PLAST_BUFFER (tb->tb_path);
 #endif
 
-#ifdef CONFIG_REISERFS_CHECK
-		    if ( ret_val )
-			reiserfs_panic (tb->tb_sb, "PAP-12240: balance_leaf: "
-					"unexpected value returned by leaf_move_items (%d)",
-					ret_val);
-#endif /* CONFIG_REISERFS_CHECK */
+		    RFALSE( ret_val,
+			    "PAP-12240: unexpected value returned by leaf_move_items (%d)",
+			    ret_val);
 
 		    /* paste into item */
 		    bi.tb = tb;
@@ -1387,14 +1269,11 @@ static int balance_leaf (struct tree_bal
 	memcpy (insert_key + i,B_N_PKEY(S_new[i],0),KEY_SIZE);
 	insert_ptr[i] = S_new[i];
 
-#ifdef CONFIG_REISERFS_CHECK
-	if (atomic_read (&(S_new[i]->b_count)) != 1) {
-	    if (atomic_read(&(S_new[i]->b_count)) != 2 ||
-	      !(buffer_journaled(S_new[i]) || buffer_journal_dirty(S_new[i]))) {
-	      reiserfs_panic (tb->tb_sb, "PAP-12247: balance_leaf: S_new[%d] : (%b)\n", i, S_new[i]);
-	    }
-	}
-#endif
+	RFALSE( (atomic_read (&(S_new[i]->b_count)) != 1) &&
+		(atomic_read(&(S_new[i]->b_count)) != 2 ||
+		 !(buffer_journaled(S_new[i]) || 
+		   buffer_journal_dirty(S_new[i]))), 
+		"PAP-12247: S_new[%d] : (%b)\n", i, S_new[i]);
 
 #if 0
 	/* update right_delimiting_key fields */
@@ -1452,10 +1331,8 @@ static int balance_leaf (struct tree_bal
 	    if (is_direntry_le_ih (pasted)) {
 		if ( pos_in_item >= 0 && pos_in_item <= le16_to_cpu (pasted->u.ih_entry_count) ) {
 
-#ifdef CONFIG_REISERFS_CHECK
-		    if ( ! tb->insert_size[0] )
-			reiserfs_panic (tb->tb_sb, "PAP-12260: balance_leaf: insert_size is 0 already");
-#endif /* CONFIG_REISERFS_CHECK */
+		    RFALSE( ! tb->insert_size[0], 
+			    "PAP-12260: insert_size is 0 already");
 
 		    /* prepare space */
 		    bi.tb = tb;
@@ -1479,12 +1356,8 @@ static int balance_leaf (struct tree_bal
 			body + DEH_SIZE, tb->insert_size[0]
 			);
 		    if ( ! item_pos && ! pos_in_item ) {
-
-#ifdef CONFIG_REISERFS_CHECK
-			if (!tb->CFL[0] || !tb->L[0])
-			    reiserfs_panic (tb->tb_sb, "PAP-12270: balance_leaf: CFL[0]/L[0] must be specified");
-#endif /* CONFIG_REISERFS_CHECK */
-
+			RFALSE( !tb->CFL[0] || !tb->L[0], 
+				"PAP-12270: CFL[0]/L[0] must be specified");
 			if (tb->CFL[0]) {
 			    replace_key(tb, tb->CFL[0], tb->lkey[0],tbS0,0);
 
@@ -1500,12 +1373,9 @@ static int balance_leaf (struct tree_bal
 		}
 	    } else { /* regular object */
 		if ( pos_in_item == pasted->ih_item_len ) {
-
-#ifdef CONFIG_REISERFS_CHECK
-		    if ( tb->insert_size[0] <= 0 )
-			reiserfs_panic (tb->tb_sb,
-					"PAP-12275: balance_leaf: insert size must not be %d", tb->insert_size[0]);
-#endif /* CONFIG_REISERFS_CHECK */
+		    RFALSE( tb->insert_size[0] <= 0,
+			    "PAP-12275: insert size must not be %d", 
+			    tb->insert_size[0]);
 		    bi.tb = tb;
 		    bi.bi_bh = tbS0;
 		    bi.bi_parent = PATH_H_PPARENT (tb->tb_path, 0);
@@ -1514,13 +1384,9 @@ static int balance_leaf (struct tree_bal
 
 		    if (is_indirect_le_ih (pasted)) {
 
-#ifdef CONFIG_REISERFS_CHECK
-			if ( tb->insert_size[0] != UNFM_P_SIZE )
-			    reiserfs_panic (tb->tb_sb,
-					    "PAP-12280: balance_leaf: insert_size for indirect item must be %d, not %d",
-					    UNFM_P_SIZE, tb->insert_size[0]);
-#endif /* CONFIG_REISERFS_CHECK */
-
+			RFALSE( tb->insert_size[0] != UNFM_P_SIZE,
+				"PAP-12280: insert_size for indirect item must be %d, not %d",
+				UNFM_P_SIZE, tb->insert_size[0]);
 			set_ih_free_space (pasted, ((struct unfm_nodeinfo*)body)->unfm_freespace);
 		    }
 		    tb->insert_size[0] = 0;
@@ -1557,10 +1423,7 @@ void make_empty_node (struct buffer_info
 {
     struct block_head * blkh;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (bi->bi_bh == NULL)
-	reiserfs_panic (0, "PAP-12295: make_empty_node: pointer to the buffer is NULL");
-#endif
+    RFALSE( bi->bi_bh == NULL, "PAP-12295: pointer to the buffer is NULL");
 
     (blkh = B_BLK_HEAD(bi->bi_bh))->blk_nr_item = cpu_to_le16 (0);
     blkh->blk_free_space = cpu_to_le16 (MAX_CHILD_SIZE(bi->bi_bh));
@@ -1646,21 +1509,17 @@ void replace_key (struct tree_balance * 
 		  struct buffer_head * src, int n_src)
 {
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (dest == NULL || src == NULL)
-	reiserfs_panic (0, "vs-12305: replace_key: sourse or destination buffer is 0 (src=%p, dest=%p)", src, dest);
-
-    if ( ! B_IS_KEYS_LEVEL (dest) )
-	reiserfs_panic (0, "vs-12310: replace_key: invalid level (%z) for destination buffer. dest must be leaf",
-			dest);
-
-    if (n_dest < 0 || n_src < 0)
-	reiserfs_panic (0, "vs-12315: replace_key: src(%d) or dest(%d) key number less than 0", n_src, n_dest);
-
-    if (n_dest >= B_NR_ITEMS(dest) || n_src >= B_NR_ITEMS(src))
-	reiserfs_panic (0, "vs-12320: replace_key: src(%d(%d)) or dest(%d(%d)) key number is too big",
-			n_src, B_NR_ITEMS(src), n_dest, B_NR_ITEMS(dest));
-#endif	/* CONFIG_REISERFS_CHECK */
+    RFALSE( dest == NULL || src == NULL,
+	    "vs-12305: source or destination buffer is 0 (src=%p, dest=%p)",
+	    src, dest);
+    RFALSE( ! B_IS_KEYS_LEVEL (dest),
+	    "vs-12310: invalid level (%z) for destination buffer. dest must be leaf",
+	    dest);
+    RFALSE( n_dest < 0 || n_src < 0,
+	    "vs-12315: src(%d) or dest(%d) key number < 0", n_src, n_dest);
+    RFALSE( n_dest >= B_NR_ITEMS(dest) || n_src >= B_NR_ITEMS(src),
+	    "vs-12320: src(%d(%d)) or dest(%d(%d)) key number is too big",
+	    n_src, B_NR_ITEMS(src), n_dest, B_NR_ITEMS(dest));
    
     if (B_IS_ITEMS_LEVEL (src))
 	/* source buffer contains leaf node */
@@ -1679,11 +1538,9 @@ int get_left_neighbor_position (
 {
   int Sh_position = PATH_H_POSITION (tb->tb_path, h + 1);
 
-#ifdef CONFIG_REISERFS_CHECK
-  if (PATH_H_PPARENT (tb->tb_path, h) == 0 || tb->FL[h] == 0)
-    reiserfs_panic (tb->tb_sb, "vs-12325: get_left_neighbor_position: FL[%d](%p) or F[%d](%p) does not exist", 
-		    h, tb->FL[h], h, PATH_H_PPARENT (tb->tb_path, h));
-#endif
+  RFALSE( PATH_H_PPARENT (tb->tb_path, h) == 0 || tb->FL[h] == 0,
+	  "vs-12325: FL[%d](%p) or F[%d](%p) does not exist", 
+	  h, tb->FL[h], h, PATH_H_PPARENT (tb->tb_path, h));
 
   if (Sh_position == 0)
     return B_NR_ITEMS (tb->FL[h]);
@@ -1696,11 +1553,9 @@ int get_right_neighbor_position (struct 
 {
   int Sh_position = PATH_H_POSITION (tb->tb_path, h + 1);
 
-#ifdef CONFIG_REISERFS_CHECK
-  if (PATH_H_PPARENT (tb->tb_path, h) == 0 || tb->FR[h] == 0)
-    reiserfs_panic (tb->tb_sb, "vs-12330: get_right_neighbor_position: F[%d](%p) or FR[%d](%p) does not exist", 
-		    h, PATH_H_PPARENT (tb->tb_path, h), h, tb->FR[h]);
-#endif
+  RFALSE( PATH_H_PPARENT (tb->tb_path, h) == 0 || tb->FR[h] == 0,
+	  "vs-12330: F[%d](%p) or FR[%d](%p) does not exist", 
+	  h, PATH_H_PPARENT (tb->tb_path, h), h, tb->FR[h]);
 
   if (Sh_position == B_NR_ITEMS (PATH_H_PPARENT (tb->tb_path, h)))
     return 0;
@@ -1717,17 +1572,14 @@ static void check_internal_node (struct 
   struct disk_child * dc;
   int i;
 
-  if (!bh)
-    reiserfs_panic (s, "PAP-12336: check_internal_node: bh == 0");
+  RFALSE( !bh, "PAP-12336: bh == 0");
 
   if (!bh || !B_IS_IN_TREE (bh))
     return;
  
-  if (!buffer_dirty (bh) && 
-      !(buffer_journaled(bh) || buffer_journal_dirty(bh))) {
-    reiserfs_panic (s, "PAP-12337: check_internal_node: buffer (%b) must be dirty", bh);
-  }
-
+  RFALSE( !buffer_dirty (bh) && 
+	  !(buffer_journaled(bh) || buffer_journal_dirty(bh)),
+	  "PAP-12337: buffer (%b) must be dirty", bh);
   dc = B_N_CHILD (bh, 0);
 
   for (i = 0; i <= B_NR_ITEMS (bh); i ++, dc ++) {
@@ -1875,18 +1727,13 @@ static inline void do_balance_starts (st
 
     /* store_print_tb (tb); */
 
-#ifdef CONFIG_REISERFS_CHECK
-
     /* do not delete, just comment it out */
 /*    print_tb(flag, PATH_LAST_POSITION(tb->tb_path), tb->tb_path->pos_in_item, tb, 
 	     "check");*/
-
-    if (check_before_balancing (tb))
-	reiserfs_panic (tb->tb_sb, "PAP-12340: do_balance: locked buffers in TB");
-
+    RFALSE( check_before_balancing (tb), "PAP-12340: locked buffers in TB");
+#ifdef CONFIG_REISERFS_CHECK
     cur_tb = tb;
-    
-#endif /* CONFIG_REISERFS_CHECK */
+#endif
 }
 
 
diff -rup linux-2.4.7-ac1/fs/reiserfs/fix_node.c linux-2.4.7-ac1.patched/fs/reiserfs/fix_node.c
--- linux-2.4.7-ac1/fs/reiserfs/fix_node.c	Fri Jul 27 22:21:51 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/fix_node.c	Fri Jul 27 22:22:27 2001
@@ -65,19 +65,14 @@ static inline int old_item_num (int new_
 
   if (mode == M_INSERT) {
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (new_num == 0)
-      reiserfs_panic (0,"vs-8005: old_item_num: for INSERT mode and item number of inserted item");
-#endif
+    RFALSE( new_num == 0, 
+	    "vs-8005: for INSERT mode and item number of inserted item");
 
     return new_num - 1;
   }
 
-#ifdef CONFIG_REISERFS_CHECK
-  if (mode != M_DELETE)
-      reiserfs_panic (0, "vs-8010: old_item_num: mode must be M_DELETE (mode = \'%c\'", mode);
-#endif
-
+  RFALSE( mode != M_DELETE,
+	  "vs-8010: old_item_num: mode must be M_DELETE (mode = \'%c\'", mode);
   /* delete mode */
   return new_num + 1;
 }
@@ -156,37 +151,14 @@ static void create_virtual_node (struct 
     if (vn->vn_mode == M_INSERT) {
 	struct virtual_item * vi = vn->vn_vi + vn->vn_affected_item_num;
       
-#ifdef CONFIG_REISERFS_CHECK
-	if (vn->vn_ins_ih == 0)
-	    reiserfs_panic (0, "vs-8040: create_virtual_node: item header of inserted item is not specified");
-#endif
-
+	RFALSE( vn->vn_ins_ih == 0,
+		"vs-8040: item header of inserted item is not specified");
 	vi->vi_item_len = tb->insert_size[0];
 	vi->vi_ih = vn->vn_ins_ih;
 	vi->vi_item = vn->vn_data;
 	vi->vi_uarea = vn->vn_free_ptr;
 	
 	op_create_vi (vn, vi, 0/*not pasted or cut*/, tb->insert_size [0]);
-#if 0
-	switch (type/*le_key_k_type (ih_version (vn->vn_ins_ih), &(vn->vn_ins_ih->ih_key))*/) {
-	case TYPE_STAT_DATA:
-	    vn->vn_vi[vn->vn_affected_item_num].vi_type |= VI_TYPE_STAT_DATA;
-	    break;
-	case TYPE_DIRECT:
-	    vn->vn_vi[vn->vn_affected_item_num].vi_type |= VI_TYPE_DIRECT;
-	    break;
-	case TYPE_INDIRECT:
-	    vn->vn_vi[vn->vn_affected_item_num].vi_type |= VI_TYPE_INDIRECT;
-	    break;
-	default:
-	    /* inseted item is directory (it must be item with "." and "..") */
-	    vn->vn_vi[vn->vn_affected_item_num].vi_type |= 
-	    	(VI_TYPE_DIRECTORY | VI_TYPE_FIRST_DIRECTORY_ITEM | VI_TYPE_INSERTED_DIRECTORY_ITEM);
-      
-	    /* this directory item can not be split, so do not set sizes of entries */
-	    break;
-	}
-#endif
     }
   
     /* set right merge flag we take right delimiting key and check whether it is a mergeable item */
@@ -227,10 +199,7 @@ static void check_left (struct tree_bala
     struct virtual_item * vi;
     int d_size, ih_size;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (cur_free < 0)
-	reiserfs_panic (0, "vs-8050: check_left: cur_free (%d) < 0", cur_free);
-#endif
+    RFALSE( cur_free < 0, "vs-8050: cur_free (%d) < 0", cur_free);
 
     /* internal level */
     if (h > 0) {	
@@ -247,19 +216,15 @@ static void check_left (struct tree_bala
 	return;
     }
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (!PATH_H_PPARENT (tb->tb_path, 0))
-	reiserfs_panic (0, "vs-8055: check_left: parent does not exist or invalid");
-#endif
+    RFALSE( !PATH_H_PPARENT (tb->tb_path, 0),
+	    "vs-8055: parent does not exist or invalid");
 
     vi = vn->vn_vi;
     if ((unsigned int)cur_free >= (vn->vn_size - ((vi->vi_type & VI_TYPE_LEFT_MERGEABLE) ? IH_SIZE : 0))) {
 	/* all contents of S[0] fits into L[0] */
 
-#ifdef CONFIG_REISERFS_CHECK
-	if (vn->vn_mode == M_INSERT || vn->vn_mode == M_PASTE)
-	    reiserfs_panic (0, "vs-8055: check_left: invalid mode or balance condition failed");
-#endif
+	RFALSE( vn->vn_mode == M_INSERT || vn->vn_mode == M_PASTE,
+		"vs-8055: invalid mode or balance condition failed");
 
 	tb->lnum[0] = vn->vn_nr_item;
 	tb->lbytes = -1;
@@ -313,10 +278,7 @@ static void check_right (struct tree_bal
     struct virtual_item * vi;
     int d_size, ih_size;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (cur_free < 0)
-	reiserfs_panic (tb->tb_sb, "vs-8070: check_right: cur_free < 0");
-#endif
+    RFALSE( cur_free < 0, "vs-8070: cur_free < 0");
     
     /* internal level */
     if (h > 0) {
@@ -333,19 +295,15 @@ static void check_right (struct tree_bal
 	return;
     }
   
-#ifdef CONFIG_REISERFS_CHECK
-    if (!PATH_H_PPARENT (tb->tb_path, 0))
-	reiserfs_panic (tb->tb_sb, "vs-8075: check_right: parent does not exist or invalid");
-#endif
+    RFALSE( !PATH_H_PPARENT (tb->tb_path, 0),
+	    "vs-8075: parent does not exist or invalid");
   
     vi = vn->vn_vi + vn->vn_nr_item - 1;
     if ((unsigned int)cur_free >= (vn->vn_size - ((vi->vi_type & VI_TYPE_RIGHT_MERGEABLE) ? IH_SIZE : 0))) {
 	/* all contents of S[0] fits into R[0] */
 	
-#ifdef CONFIG_REISERFS_CHECK
-	if (vn->vn_mode == M_INSERT || vn->vn_mode == M_PASTE)
-	    reiserfs_panic (tb->tb_sb, "vs-8080: check_right: invalid mode or balance condition failed");
-#endif
+	RFALSE( vn->vn_mode == M_INSERT || vn->vn_mode == M_PASTE,
+		"vs-8080: invalid mode or balance condition failed");
 
 	tb->rnum[h] = vn->vn_nr_item;
 	tb->rbytes = -1;
@@ -422,14 +380,12 @@ static int get_num_ver (int mode, struct
     split_item_positions[0] = -1;
     split_item_positions[1] = -1;
 
-#ifdef CONFIG_REISERFS_CHECK
     /* We only create additional nodes if we are in insert or paste mode
        or we are in replace mode at the internal level. If h is 0 and
        the mode is M_REPLACE then in fix_nodes we change the mode to
        paste or insert before we get here in the code.  */
-    if ( tb->insert_size[h] < 0  || (mode != M_INSERT && mode != M_PASTE))
-	reiserfs_panic (0, "vs-8100: get_num_ver: insert_size < 0 in overflow");
-#endif
+    RFALSE( tb->insert_size[h] < 0  || (mode != M_INSERT && mode != M_PASTE),
+	    "vs-8100: insert_size < 0 in overflow");
 
     max_node_size = MAX_CHILD_SIZE (PATH_H_PBUFFER (tb->tb_path, h));
 
@@ -469,11 +425,7 @@ static int get_num_ver (int mode, struct
 	struct virtual_item * vi = vn->vn_vi + i;
 	int skip_from_end = ((i == end_item) ? end_bytes : 0);
 
-#ifdef CONFIG_REISERFS_CHECK
-	if (needed_nodes > 3) {
-	    reiserfs_panic (tb->tb_sb, "vs-8105: get_num_ver: too many nodes are needed");
-	}
-#endif
+	RFALSE( needed_nodes > 3, "vs-8105: too many nodes are needed");
 
 	/* get size of current item */
 	current_item_size = vi->vi_item_len;
@@ -495,12 +447,10 @@ static int get_num_ver (int mode, struct
 	if (current_item_size > max_node_size) {
 	    /* virtual item length is longer, than max size of item in
                a node. It is impossible for direct item */
-#ifdef CONFIG_REISERFS_CHECK
-	    if (is_direct_le_ih (vi->vi_ih))
-		reiserfs_panic (tb->tb_sb, "vs-8110: get_num_ver: "
-				"direct item length is %d. It can not be longer than %d", 
-				current_item_size, max_node_size);
-#endif
+	    RFALSE( is_direct_le_ih (vi->vi_ih),
+		    "vs-8110: "
+		    "direct item length is %d. It can not be longer than %d",
+		    current_item_size, max_node_size);
 	    /* we will try to split it */
 	    flow = 1;
 	}
@@ -691,10 +641,8 @@ static int are_leaves_removable (struct 
 	/* there was only one item and it will be deleted */
 	struct item_head * ih;
     
-#ifdef CONFIG_REISERFS_CHECK
-    if (B_NR_ITEMS (S0) != 1)
-      reiserfs_panic (0, "vs-8125: are_leaves_removable: item number must be 1: it is %d", B_NR_ITEMS(S0));
-#endif
+    RFALSE( B_NR_ITEMS (S0) != 1,
+	    "vs-8125: item number must be 1: it is %d", B_NR_ITEMS(S0));
 
     ih = B_N_PITEM_HEAD (S0, 0);
     if (tb->CFR[0] && !comp_short_le_keys (&(ih->ih_key), B_N_PDELIM_KEY (tb->CFR[0], tb->rkey[0])))
@@ -708,13 +656,11 @@ static int are_leaves_removable (struct 
 	       we can save ih_size */
 	    ih_size = IH_SIZE;
 	    
-#ifdef CONFIG_REISERFS_CHECK
 	    /* we might check that left neighbor exists and is of the
 	       same directory */
-	    if (le_key_k_offset (ih_version (ih), &(ih->ih_key)) == DOT_OFFSET)
-		reiserfs_panic (tb->tb_sb, "vs-8130: are_leaves_removable: "
-				"first directory item can not be removed until directory is not empty");
-#endif
+	    RFALSE( le_key_k_offset 
+		    (ih_version (ih), &(ih->ih_key)) == DOT_OFFSET,
+		    "vs-8130: first directory item can not be removed until directory is not empty");
       }
     
   }
@@ -852,10 +798,8 @@ static int  get_empty_nodes(
   for ( p_n_blocknr = a_n_blocknrs, n_counter = 0; n_counter < n_amount_needed;
 	p_n_blocknr++, n_counter++ ) { 
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( ! *p_n_blocknr )
-      reiserfs_panic(p_s_sb, "PAP-8135: get_empty_nodes: reiserfs_new_blocknrs failed when got new blocks");
-#endif
+    RFALSE( ! *p_n_blocknr,
+	    "PAP-8135: reiserfs_new_blocknrs failed when got new blocks");
 
     p_s_new_bh = reiserfs_getblk(p_s_sb->s_dev, *p_n_blocknr, p_s_sb->s_blocksize);
     if (atomic_read (&(p_s_new_bh->b_count)) > 1) {
@@ -873,15 +817,13 @@ static int  get_empty_nodes(
 	wait_buffer_until_released (p_s_new_bh);
       }
     }
-#ifdef CONFIG_REISERFS_CHECK
-    if (atomic_read (&(p_s_new_bh->b_count)) != 1 || buffer_dirty (p_s_new_bh)) {
-      if (atomic_read(&(p_s_new_bh->b_count)) > 2 || 
-          !(buffer_journaled(p_s_new_bh) || buffer_journal_dirty(p_s_new_bh))) {
-	reiserfs_panic(p_s_sb,"PAP-8140: get_empty_nodes: not free or dirty buffer %b for the new block",
-		     p_s_new_bh);
-      }
-    }
-#endif
+    RFALSE( (atomic_read (&(p_s_new_bh->b_count)) != 1 || 
+	     buffer_dirty (p_s_new_bh)) && 
+	    (atomic_read(&(p_s_new_bh->b_count)) > 2 || 
+	     !(buffer_journaled(p_s_new_bh) || 
+	       buffer_journal_dirty(p_s_new_bh))),
+	    "PAP-8140: not free or dirty buffer %b for the new block", 
+	    p_s_new_bh);
     
     /* Put empty buffers into the array. */
     if (p_s_tb->FEB[p_s_tb->cur_blknum])
@@ -958,13 +900,13 @@ static int  is_left_neighbor_in_cache(
   /* Calculate father of the node to be balanced. */
   p_s_father = PATH_H_PBUFFER(p_s_tb->tb_path, n_h + 1);
 
-#ifdef CONFIG_REISERFS_CHECK
-  if ( ! p_s_father || ! B_IS_IN_TREE (p_s_father) || ! B_IS_IN_TREE (p_s_tb->FL[n_h]) ||
-       ! buffer_uptodate (p_s_father) || ! buffer_uptodate (p_s_tb->FL[n_h]) ) {
-    reiserfs_panic (p_s_sb, "vs-8165: is_left_neighbor_in_cache: F[h] (%b) or FL[h] (%b) is invalid",
-		    p_s_father, p_s_tb->FL[n_h]);
-  }
-#endif
+  RFALSE( ! p_s_father || 
+	  ! B_IS_IN_TREE (p_s_father) || 
+	  ! B_IS_IN_TREE (p_s_tb->FL[n_h]) ||
+	  ! buffer_uptodate (p_s_father) || 
+	  ! buffer_uptodate (p_s_tb->FL[n_h]),
+	  "vs-8165: F[h] (%b) or FL[h] (%b) is invalid", 
+	  p_s_father, p_s_tb->FL[n_h]);
 
 
   /* Get position of the pointer to the left neighbor into the left father. */
@@ -975,12 +917,8 @@ static int  is_left_neighbor_in_cache(
   /* Look for the left neighbor in the cache. */
   if ( (left = get_hash_table(p_s_sb->s_dev, n_left_neighbor_blocknr, p_s_sb->s_blocksize)) ) {
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( buffer_uptodate (left) && ! B_IS_IN_TREE(left) ) {
-      reiserfs_panic(p_s_sb, "vs-8170: is_left_neighbor_in_cache: left neighbor (%b %z) is not in the tree",
-		     left, left);
-    }
-#endif
+    RFALSE( buffer_uptodate (left) && ! B_IS_IN_TREE(left),
+	    "vs-8170: left neighbor (%b %z) is not in the tree", left, left);
     atomic_dec (&(left->b_count));
     return 1;
   }
@@ -997,28 +935,6 @@ static void decrement_key (struct cpu_ke
 {
     // call item specific function for this key
     item_ops[cpu_key_k_type (p_s_key)]->decrement_key (p_s_key);
-    
-
-#if 0 /* this works wrong when key is key of second part of tail: it
-         sets key to be of indirect type. It looks like it makes no
-         harm but it is unclear */
-
-  unsigned long * p_n_key_field = (unsigned long *)p_s_key + REISERFS_FULL_KEY_LEN - 1;
-  int		  n_counter;
-
-  for( n_counter = 0; n_counter < REISERFS_FULL_KEY_LEN; n_counter++, p_n_key_field-- ) {
-      if ( *p_n_key_field ) {
-	  (*p_n_key_field)--;
-	  break;
-      }
-  }
-#ifdef CONFIG_REISERFS_CHECK
-  if ( n_counter == REISERFS_FULL_KEY_LEN )
-      reiserfs_panic(NULL, "PAP-8175: decrement_key: zero key");
-#endif
-
-#endif /*0*/
-
 }
 
 
@@ -1052,10 +968,8 @@ static int  get_far_parent (struct tree_
 
     n_counter = n_path_offset;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( n_counter < FIRST_PATH_ELEMENT_OFFSET )
-	reiserfs_panic(p_s_tb->tb_sb, "PAP-8180: get_far_parent: invalid path length");
-#endif
+    RFALSE( n_counter < FIRST_PATH_ELEMENT_OFFSET,
+	    "PAP-8180: invalid path length");
 
   
     for ( ; n_counter > FIRST_PATH_ELEMENT_OFFSET; n_counter--  )  {
@@ -1091,11 +1005,9 @@ static int  get_far_parent (struct tree_
 	return REPEAT_SEARCH;
     }
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( B_LEVEL (*pp_s_com_father) <= DISK_LEAF_NODE_LEVEL ) {
-	reiserfs_panic(p_s_tb->tb_sb, "PAP-8185: get_far_parent: (%b %z) level too small", *pp_s_com_father, *pp_s_com_father);
-    }
-#endif
+    RFALSE( B_LEVEL (*pp_s_com_father) <= DISK_LEAF_NODE_LEVEL,
+	    "PAP-8185: (%b %z) level too small", 
+	    *pp_s_com_father, *pp_s_com_father);
 
     /* Check whether the common parent is locked. */
 
@@ -1130,15 +1042,10 @@ static int  get_far_parent (struct tree_
 
     *pp_s_father = PATH_PLAST_BUFFER(&s_path_to_neighbor_father);
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( B_LEVEL (*pp_s_father) != n_h + 1 ) {
-	reiserfs_panic(p_s_tb->tb_sb, "PAP-8190: get_far_parent: (%b %z) level too small", *pp_s_father, *pp_s_father);
-    }
-  
-    if ( s_path_to_neighbor_father.path_length < FIRST_PATH_ELEMENT_OFFSET )
-	reiserfs_panic(0, "PAP-8192: get_far_parent: path length is too small");
-
-#endif
+    RFALSE( B_LEVEL (*pp_s_father) != n_h + 1,
+	    "PAP-8190: (%b %z) level too small", *pp_s_father, *pp_s_father);
+    RFALSE( s_path_to_neighbor_father.path_length < FIRST_PATH_ELEMENT_OFFSET,
+	    "PAP-8192: path length is too small");
 
     s_path_to_neighbor_father.path_length--;
     decrement_counters_in_path(&s_path_to_neighbor_father);
@@ -1198,11 +1105,9 @@ static int  get_parents (struct tree_bal
     decrement_bcount(p_s_tb->CFL[n_h]);
     p_s_tb->CFL[n_h] = p_s_curcf; /* New initialization of CFL[n_h]. */
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ((p_s_curf && !B_IS_IN_TREE (p_s_curf)) || (p_s_curcf && !B_IS_IN_TREE (p_s_curcf))) {
-	reiserfs_panic (p_s_tb->tb_sb, "PAP-8195: get_parents: FL (%b) or CFL (%b) is invalid", p_s_curf, p_s_curcf);
-    }
-#endif
+    RFALSE( (p_s_curf && !B_IS_IN_TREE (p_s_curf)) || 
+	    (p_s_curcf && !B_IS_IN_TREE (p_s_curcf)),
+	    "PAP-8195: FL (%b) or CFL (%b) is invalid", p_s_curf, p_s_curcf);
 
 /* Get parent FR[n_h] of R[n_h]. */
 
@@ -1237,10 +1142,10 @@ static int  get_parents (struct tree_bal
 			B_PRIGHT_DELIM_KEY (PATH_H_PBUFFER(p_s_path, n_h)), B_N_PDELIM_KEY (p_s_tb->CFR[n_h], p_s_tb->rkey[n_h]));
     }
 #endif
-    if ((p_s_curf && !B_IS_IN_TREE (p_s_curf)) || (p_s_curcf && !B_IS_IN_TREE (p_s_curcf))) {
-	reiserfs_panic (p_s_tb->tb_sb, "PAP-8205: get_parents: FR (%b) or CFR (%b) is invalid", p_s_curf, p_s_curcf);
-    }
 #endif
+    RFALSE( (p_s_curf && !B_IS_IN_TREE (p_s_curf)) || 
+	    (p_s_curcf && !B_IS_IN_TREE (p_s_curcf)),
+	    "PAP-8205: FR (%b) or CFR (%b) is invalid", p_s_curf, p_s_curcf);
 
     return CARRY_ON;
 }
@@ -1400,15 +1305,14 @@ static int ip_check_balance (struct tree
 	return CARRY_ON;
     }
 
-#ifdef CONFIG_REISERFS_CHECK
     /* this checks balance condition, that any two neighboring nodes can not fit in one node */
-    if ( h && ( tb->lnum[h] >= vn->vn_nr_item + 1 || tb->rnum[h] >= vn->vn_nr_item + 1) )
-	reiserfs_panic (tb->tb_sb, "vs-8220: ip_check_balance: tree is not balanced on internal level");
-
-    if ( ! h && ((tb->lnum[h] >= vn->vn_nr_item && (tb->lbytes == -1)) ||
-		 (tb->rnum[h] >= vn->vn_nr_item && (tb->rbytes == -1)) ))
-	reiserfs_panic(tb->tb_sb, "vs-8225: ip_check_balance: tree is not balanced on leaf level");
-#endif
+    RFALSE( h && 
+	    ( tb->lnum[h] >= vn->vn_nr_item + 1 || 
+	      tb->rnum[h] >= vn->vn_nr_item + 1),
+	    "vs-8220: tree is not balanced on internal level");
+    RFALSE( ! h && ((tb->lnum[h] >= vn->vn_nr_item && (tb->lbytes == -1)) ||
+		    (tb->rnum[h] >= vn->vn_nr_item && (tb->rbytes == -1)) ),
+	    "vs-8225: tree is not balanced on leaf level");
 
     /* all contents of S[0] can be moved into its neighbors
        S[0] will be removed after balancing. */
@@ -1553,10 +1457,11 @@ static int ip_check_balance (struct tree
 	/* we can win TWO or ONE nodes by shifting in both directions */
 	if (lrnver < lnver && lrnver < rnver)
 	{
-#ifdef CONFIG_REISERFS_CHECK
-	    if (h && (tb->lnum[h] != 1 || tb->rnum[h] != 1 || lrnver != 1 || rnver != 2 || lnver != 2 || h != 1))
-		reiserfs_panic (0, "vs-8230: check_balance: bad h");
-#endif
+	    RFALSE( h && 
+		    (tb->lnum[h] != 1 || 
+		     tb->rnum[h] != 1 || 
+		     lrnver != 1 || rnver != 2 || lnver != 2 || h != 1),
+		    "vs-8230: bad h");
 	    if (lrset == LR_SHIFT_FLOW)
 		set_parameters (tb, h, tb->lnum[h], tb->rnum[h], lrnver, snum012 + lrset,
 				tb->lbytes, tb->rbytes);
@@ -1757,10 +1662,7 @@ static int dc_check_balance_internal (st
     }
 
   /* For internal nodes try to borrow item from a neighbor */
-#ifdef CONFIG_REISERFS_CHECK
-  if (!tb->FL[h] && !tb->FR[h])
-    reiserfs_panic (0, "vs-8235: dc_check_balance_internal: trying to borrow for root");
-#endif
+  RFALSE( !tb->FL[h] && !tb->FR[h], "vs-8235: trying to borrow for root");
 
   /* Borrow one or two items from caching neighbor */
   if (is_left_neighbor_in_cache (tb,h) || !tb->FR[h])
@@ -1818,10 +1720,8 @@ static int dc_check_balance_leaf (struct
   if ( ! F0 )
     {  /* S[0] is the root now. */
 
-#ifdef CONFIG_REISERFS_CHECK
-      if ( -levbytes >= maxsize - B_FREE_SPACE (S0) )
-	reiserfs_panic (tb->tb_sb, "vs-8240: dc_check_balance_leaf: attempt to create empty buffer tree");
-#endif
+      RFALSE( -levbytes >= maxsize - B_FREE_SPACE (S0),
+	      "vs-8240: attempt to create empty buffer tree");
 
       set_parameters (tb, h, 0, 0, 1, NULL, -1, -1);
       return NO_BALANCING_NEEDED;
@@ -1853,10 +1753,7 @@ static int dc_check_balance_leaf (struct
 	((tb->rnum[0] - ((tb->rbytes == -1) ? 0 : 1)) < vn->vn_nr_item) || /* S can not be merged with R */
 	!tb->FR[h]) {
       
-#ifdef CONFIG_REISERFS_CHECK
-      if (!tb->FL[h])
-	reiserfs_panic (0, "vs-8245: dc_check_balance_leaf: FL[h] must exist");
-#endif
+      RFALSE( !tb->FL[h], "vs-8245: dc_check_balance_leaf: FL[h] must exist");
 
       /* set parameter to merge S[0] with its left neighbor */
       set_parameters (tb, h, -1, 0, 0, NULL, -1, -1);
@@ -1896,11 +1793,7 @@ static int dc_check_balance_leaf (struct
  */
 static int dc_check_balance (struct tree_balance * tb, int h)
 {
-
-#ifdef CONFIG_REISERFS_CHECK
- if ( ! (PATH_H_PBUFFER (tb->tb_path, h)) )
-   reiserfs_panic(tb->tb_sb, "vs-8250: dc_check_balance: S is not initialized");
-#endif
+ RFALSE( ! (PATH_H_PBUFFER (tb->tb_path, h)), "vs-8250: S is not initialized");
 
  if ( h )
    return dc_check_balance_internal (tb, h);
@@ -1947,10 +1840,8 @@ static int check_balance (int mode, 
   vn->vn_ins_ih = ins_ih;
   vn->vn_data = data;
 
-#ifdef CONFIG_REISERFS_CHECK
-  if (mode == M_INSERT && !vn->vn_ins_ih)
-    reiserfs_panic (0, "vs-8255: check_balance: ins_ih can not be 0 in insert mode");
-#endif
+  RFALSE( mode == M_INSERT && !vn->vn_ins_ih,
+	  "vs-8255: ins_ih can not be 0 in insert mode");
 
  if ( tb->insert_size[h] > 0 )
    /* Calculate balance parameters when size of node is increasing. */
@@ -1975,10 +1866,8 @@ static int  get_direct_parent(
     /* We are in the root or in the new root. */
     if ( n_path_offset <= FIRST_PATH_ELEMENT_OFFSET ) {
 	
-#ifdef CONFIG_REISERFS_CHECK
-	if ( n_path_offset < FIRST_PATH_ELEMENT_OFFSET - 1 )
-	    reiserfs_panic(p_s_tb->tb_sb, "PAP-8260: get_direct_parent: illegal offset in the path");
-#endif
+	RFALSE( n_path_offset < FIRST_PATH_ELEMENT_OFFSET - 1,
+		"PAP-8260: illegal offset in the path");
 
 	if ( PATH_OFFSET_PBUFFER(p_s_path, FIRST_PATH_ELEMENT_OFFSET)->b_blocknr ==
 	     SB_ROOT_BLOCK (p_s_tb->tb_sb) ) {
@@ -2031,10 +1920,9 @@ static int  get_neighbors(
 	/* We need left neighbor to balance S[n_h]. */
 	p_s_bh = PATH_OFFSET_PBUFFER(p_s_tb->tb_path, n_path_offset);
 	
-#ifdef CONFIG_REISERFS_CHECK
-	if ( p_s_bh == p_s_tb->FL[n_h] && ! PATH_OFFSET_POSITION(p_s_tb->tb_path, n_path_offset) )
-	    reiserfs_panic (p_s_tb->tb_sb, "PAP-8270: get_neighbors: invalid position in the parent");
-#endif
+	RFALSE( p_s_bh == p_s_tb->FL[n_h] && 
+		! PATH_OFFSET_POSITION(p_s_tb->tb_path, n_path_offset),
+		"PAP-8270: invalid position in the parent");
 
 	n_child_position = ( p_s_bh == p_s_tb->FL[n_h] ) ? p_s_tb->lkey[n_h] : B_NR_ITEMS (p_s_tb->FL[n_h]);
 	n_son_number = B_N_CHILD_NUM(p_s_tb->FL[n_h], n_child_position);
@@ -2046,16 +1934,14 @@ static int  get_neighbors(
 	    return REPEAT_SEARCH;
 	}
 	
-#ifdef CONFIG_REISERFS_CHECK
-	if ( ! B_IS_IN_TREE(p_s_tb->FL[n_h]) || n_child_position > B_NR_ITEMS(p_s_tb->FL[n_h]) ||
-	     B_N_CHILD_NUM(p_s_tb->FL[n_h], n_child_position) != p_s_bh->b_blocknr )
-	    reiserfs_panic (p_s_tb->tb_sb, "PAP-8275: get_neighbors: invalid parent");
-	if ( ! B_IS_IN_TREE(p_s_bh) )
-	    reiserfs_panic (p_s_tb->tb_sb, "PAP-8280: get_neighbors: invalid child");
-
-	if (! n_h && B_FREE_SPACE (p_s_bh) != MAX_CHILD_SIZE (p_s_bh) - B_N_CHILD (p_s_tb->FL[0],n_child_position)->dc_size)
-	    reiserfs_panic (p_s_tb->tb_sb, "PAP-8290: get_neighbors: invalid child size of left neighbor");
-#endif
+	RFALSE( ! B_IS_IN_TREE(p_s_tb->FL[n_h]) || 
+		n_child_position > B_NR_ITEMS(p_s_tb->FL[n_h]) ||
+		B_N_CHILD_NUM(p_s_tb->FL[n_h], n_child_position) != 
+		p_s_bh->b_blocknr, "PAP-8275: invalid parent");
+	RFALSE( ! B_IS_IN_TREE(p_s_bh), "PAP-8280: invalid child");
+	RFALSE( ! n_h && 
+		B_FREE_SPACE (p_s_bh) != MAX_CHILD_SIZE (p_s_bh) - B_N_CHILD (p_s_tb->FL[0],n_child_position)->dc_size,
+		"PAP-8290: invalid child size of left neighbor");
 
 	decrement_bcount(p_s_tb->L[n_h]);
 	p_s_tb->L[n_h] = p_s_bh;
@@ -2065,10 +1951,9 @@ static int  get_neighbors(
     if ( p_s_tb->rnum[n_h] ) { /* We need right neighbor to balance S[n_path_offset]. */
 	p_s_bh = PATH_OFFSET_PBUFFER(p_s_tb->tb_path, n_path_offset);
 	
-#ifdef CONFIG_REISERFS_CHECK
-	if ( p_s_bh == p_s_tb->FR[n_h] && PATH_OFFSET_POSITION(p_s_tb->tb_path, n_path_offset) >= B_NR_ITEMS(p_s_bh) )
-	    reiserfs_panic (p_s_tb->tb_sb, "PAP-8295: get_neighbors: invalid position in the parent");
-#endif
+	RFALSE( p_s_bh == p_s_tb->FR[n_h] && 
+		PATH_OFFSET_POSITION(p_s_tb->tb_path, n_path_offset) >= B_NR_ITEMS(p_s_bh),
+		"PAP-8295: invalid position in the parent");
 
 	n_child_position = ( p_s_bh == p_s_tb->FR[n_h] ) ? p_s_tb->rkey[n_h] + 1 : 0;
 	n_son_number = B_N_CHILD_NUM(p_s_tb->FR[n_h], n_child_position);
@@ -2082,12 +1967,10 @@ static int  get_neighbors(
 	decrement_bcount(p_s_tb->R[n_h]);
 	p_s_tb->R[n_h] = p_s_bh;
 
-#ifdef CONFIG_REISERFS_CHECK
-	if (! n_h && B_FREE_SPACE (p_s_bh) != MAX_CHILD_SIZE (p_s_bh) - B_N_CHILD (p_s_tb->FR[0],n_child_position)->dc_size) {
-	    reiserfs_panic (p_s_tb->tb_sb, "PAP-8300: get_neighbors: invalid child size of right neighbor (%d != %d - %d)",
-			    B_FREE_SPACE (p_s_bh), MAX_CHILD_SIZE (p_s_bh), B_N_CHILD (p_s_tb->FR[0],n_child_position)->dc_size);
-	}
-#endif
+	RFALSE( ! n_h && B_FREE_SPACE (p_s_bh) != MAX_CHILD_SIZE (p_s_bh) - B_N_CHILD (p_s_tb->FR[0],n_child_position)->dc_size,
+		"PAP-8300: invalid child size of right neighbor (%d != %d - %d)",
+		B_FREE_SPACE (p_s_bh), MAX_CHILD_SIZE (p_s_bh), 
+		B_N_CHILD (p_s_tb->FR[0],n_child_position)->dc_size);
 	
     }
     return CARRY_ON;
@@ -2236,6 +2119,11 @@ static void tb_buffer_sanity_check (stru
     }
   }
 }
+#else
+static void tb_buffer_sanity_check (struct super_block * p_s_sb,
+				    struct buffer_head * p_s_bh, 
+				    const char *descr, int level)
+{;}
 #endif
 
 static void clear_all_dirty_bits(struct super_block *s, 
@@ -2282,27 +2170,21 @@ static int wait_tb_buffers_until_unlocke
 	    if (p_s_tb->lnum[i] ) {
 
 		if ( p_s_tb->L[i] ) {
-#ifdef CONFIG_REISERFS_CHECK
 		    tb_buffer_sanity_check (p_s_tb->tb_sb, p_s_tb->L[i], "L", i);
-#endif
 		    clear_all_dirty_bits(p_s_tb->tb_sb, p_s_tb->L[i]) ;
 		    if ( buffer_locked (p_s_tb->L[i]) )
 			locked = p_s_tb->L[i];
 		}
 
 		if ( !locked && p_s_tb->FL[i] ) {
-#ifdef CONFIG_REISERFS_CHECK
 		    tb_buffer_sanity_check (p_s_tb->tb_sb, p_s_tb->FL[i], "FL", i);
-#endif
 		    clear_all_dirty_bits(p_s_tb->tb_sb, p_s_tb->FL[i]) ;
 		    if ( buffer_locked (p_s_tb->FL[i]) )
 			locked = p_s_tb->FL[i];
 		}
 
 		if ( !locked && p_s_tb->CFL[i] ) {
-#ifdef CONFIG_REISERFS_CHECK
 		    tb_buffer_sanity_check (p_s_tb->tb_sb, p_s_tb->CFL[i], "CFL", i);
-#endif
 		    clear_all_dirty_bits(p_s_tb->tb_sb, p_s_tb->CFL[i]) ;
 		    if ( buffer_locked (p_s_tb->CFL[i]) )
 			locked = p_s_tb->CFL[i];
@@ -2313,9 +2195,7 @@ static int wait_tb_buffers_until_unlocke
 	    if ( !locked && (p_s_tb->rnum[i]) ) {
 
 		if ( p_s_tb->R[i] ) {
-#ifdef CONFIG_REISERFS_CHECK
 		    tb_buffer_sanity_check (p_s_tb->tb_sb, p_s_tb->R[i], "R", i);
-#endif
 		    clear_all_dirty_bits(p_s_tb->tb_sb, p_s_tb->R[i]) ;
 		    if ( buffer_locked (p_s_tb->R[i]) )
 			locked = p_s_tb->R[i];
@@ -2323,18 +2203,14 @@ static int wait_tb_buffers_until_unlocke
 
        
 		if ( !locked && p_s_tb->FR[i] ) {
-#ifdef CONFIG_REISERFS_CHECK
 		    tb_buffer_sanity_check (p_s_tb->tb_sb, p_s_tb->FR[i], "FR", i);
-#endif
 		    clear_all_dirty_bits(p_s_tb->tb_sb, p_s_tb->FR[i]) ;
 		    if ( buffer_locked (p_s_tb->FR[i]) )
 			locked = p_s_tb->FR[i];
 		}
 
 		if ( !locked && p_s_tb->CFR[i] ) {
-#ifdef CONFIG_REISERFS_CHECK
 		    tb_buffer_sanity_check (p_s_tb->tb_sb, p_s_tb->CFR[i], "CFR", i);
-#endif
 		    clear_all_dirty_bits(p_s_tb->tb_sb, p_s_tb->CFR[i]) ;
 		    if ( buffer_locked (p_s_tb->CFR[i]) )
 			locked = p_s_tb->CFR[i];
@@ -2536,10 +2412,8 @@ int fix_nodes (int n_op_mode,
 	    /* We have a positive insert size but no nodes exist on this
 	       level, this means that we are creating a new root. */
 
-#ifdef CONFIG_REISERFS_CHECK
-	    if ( p_s_tb->blknum[n_h] != 1 )
-		reiserfs_panic(p_s_tb->tb_sb,"PAP-8350: fix_nodes: creating new empty root");
-#endif /* CONFIG_REISERFS_CHECK */
+	    RFALSE( p_s_tb->blknum[n_h] != 1,
+		    "PAP-8350: creating new empty root");
 
 	    if ( n_h < MAX_HEIGHT - 1 )
 		p_s_tb->insert_size[n_h + 1] = 0;
@@ -2552,10 +2426,8 @@ int fix_nodes (int n_op_mode,
 		       and a new node (S[n_h+1]) will be created to
 		       become the root node.  */
 	  
-#ifdef CONFIG_REISERFS_CHECK
-		    if ( n_h == MAX_HEIGHT - 1 )
-			reiserfs_panic(p_s_tb->tb_sb, "PAP-8355: fix_nodes: attempt to create too high of a tree");
-#endif /* CONFIG_REISERFS_CHECK */
+		    RFALSE( n_h == MAX_HEIGHT - 1,
+			    "PAP-8355: attempt to create too high of a tree");
 
 		    p_s_tb->insert_size[n_h + 1] = (DC_SIZE + KEY_SIZE) * (p_s_tb->blknum[n_h] - 1) + DC_SIZE;
 		}
diff -rup linux-2.4.7-ac1/fs/reiserfs/ibalance.c linux-2.4.7-ac1.patched/fs/reiserfs/ibalance.c
--- linux-2.4.7-ac1/fs/reiserfs/ibalance.c	Fri Jul 27 22:21:51 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/ibalance.c	Fri Jul 27 22:22:27 2001
@@ -36,10 +36,8 @@ static void	internal_define_dest_src_inf
 						struct buffer_head ** cf
 						)
 {
-#ifdef CONFIG_REISERFS_CHECK
     memset (dest_bi, 0, sizeof (struct buffer_info));
     memset (src_bi, 0, sizeof (struct buffer_info));
-#endif
     /* define dest, src, dest parent, dest position */
     switch (shift_mode) {
     case INTERNAL_SHIFT_FROM_S_TO_L:	/* used in internal_shift_left */
@@ -144,13 +142,11 @@ static void internal_insert_childs (stru
 
     nr = le16_to_cpu ((blkh = B_BLK_HEAD(cur))->blk_nr_item);
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (count > 2)
-	reiserfs_panic (0, "internal_insert_childs", "too many children (%d) are to be inserted", count);
-    if (B_FREE_SPACE (cur) < count * (KEY_SIZE + DC_SIZE))
-	reiserfs_panic (0, "internal_insert_childs", "no enough free space (%d), needed %d bytes", 
-			B_FREE_SPACE (cur), count * (KEY_SIZE + DC_SIZE));
-#endif /* CONFIG_REISERFS_CHECK */
+    RFALSE( count > 2,
+	    "too many children (%d) are to be inserted", count);
+    RFALSE( B_FREE_SPACE (cur) < count * (KEY_SIZE + DC_SIZE),
+	    "no enough free space (%d), needed %d bytes", 
+	    B_FREE_SPACE (cur), count * (KEY_SIZE + DC_SIZE));
 
     /* prepare space for count disk_child */
     dc = B_N_CHILD(cur,to+1);
@@ -213,43 +209,29 @@ static void	internal_delete_pointers_ite
   struct key * key;
   struct disk_child * dc;
 
-#ifdef CONFIG_REISERFS_CHECK
-  if (cur == NULL)
-    reiserfs_panic (0, "internal_delete_pointers_items1: buffer is 0");
-	
-  if (del_num < 0)
-    reiserfs_panic (0, "internal_delete_pointers_items2",
-		    "negative number of items (%d) can not be deleted", del_num);
-
-  if (first_p < 0 || first_p + del_num > B_NR_ITEMS (cur) + 1 || first_i < 0)
-    reiserfs_panic (0, "internal_delete_pointers_items3",
-		    "first pointer order (%d) < 0 or "
-		    "no so many pointers (%d), only (%d) or "
-		    "first key order %d < 0", first_p, 
-		    first_p + del_num, B_NR_ITEMS (cur) + 1, first_i);
-#endif /* CONFIG_REISERFS_CHECK */
+  RFALSE( cur == NULL, "buffer is 0");
+  RFALSE( del_num < 0, 
+	  "negative number of items (%d) can not be deleted", del_num);
+  RFALSE( first_p < 0 || first_p + del_num > B_NR_ITEMS (cur) + 1 || first_i < 0,
+	  "first pointer order (%d) < 0 or "
+	  "no so many pointers (%d), only (%d) or "
+	  "first key order %d < 0", first_p, 
+	  first_p + del_num, B_NR_ITEMS (cur) + 1, first_i);
   if ( del_num == 0 )
     return;
 
   nr = le16_to_cpu ((blkh = B_BLK_HEAD(cur))->blk_nr_item);
 
   if ( first_p == 0 && del_num == nr + 1 ) {
-#ifdef CONFIG_REISERFS_CHECK
-    if ( first_i != 0 )
-      reiserfs_panic (0, "internal_delete_pointers_items5",
-		      "first deleted key must have order 0, not %d", first_i);
-#endif /* CONFIG_REISERFS_CHECK */
+    RFALSE( first_i != 0, "1st deleted key must have order 0, not %d", first_i);
     make_empty_node (cur_bi);
     return;
   }
 
-#ifdef CONFIG_REISERFS_CHECK
-  if (first_i + del_num > B_NR_ITEMS (cur)) {
-    printk("first_i = %d del_num = %d\n",first_i,del_num);
-    reiserfs_panic (0, "internal_delete_pointers_items4: :"
-		    "no so many keys (%d) in the node (%b)(%z)", first_i + del_num, cur, cur);
-  }
-#endif /* CONFIG_REISERFS_CHECK */
+  RFALSE( first_i + del_num > B_NR_ITEMS (cur),
+	  "first_i = %d del_num = %d "
+	  "no so many keys (%d) in the node (%b)(%z)", 
+	  first_i, del_num, first_i + del_num, cur, cur);
 
 
   /* deleting */
@@ -315,25 +297,16 @@ static void internal_copy_pointers_items
 
   nr_src = B_NR_ITEMS (src);
 
-#ifdef CONFIG_REISERFS_CHECK
-  if ( dest == NULL || src == NULL )
-    reiserfs_panic (0, "internal_copy_pointers_items", "src (%p) or dest (%p) buffer is 0", src, dest);
-
-  if (last_first != FIRST_TO_LAST && last_first != LAST_TO_FIRST)
-    reiserfs_panic (0, "internal_copy_pointers_items",
-		    "invalid last_first parameter (%d)", last_first);
-
-  if ( nr_src < cpy_num - 1 )
-    reiserfs_panic (0, "internal_copy_pointers_items", "no so many items (%d) in src (%d)", cpy_num, nr_src);
-
-  if ( cpy_num < 0 )
-    reiserfs_panic (0, "internal_copy_pointers_items", "cpy_num less than 0 (%d)", cpy_num);
-
-  if (cpy_num - 1 + B_NR_ITEMS(dest) > (int)MAX_NR_KEY(dest))
-    reiserfs_panic (0, "internal_copy_pointers_items",
-		    "cpy_num (%d) + item number in dest (%d) can not be more than MAX_NR_KEY(%d)",
-		    cpy_num, B_NR_ITEMS(dest), MAX_NR_KEY(dest));
-#endif
+  RFALSE( dest == NULL || src == NULL, 
+	  "src (%p) or dest (%p) buffer is 0", src, dest);
+  RFALSE( last_first != FIRST_TO_LAST && last_first != LAST_TO_FIRST,
+	  "invalid last_first parameter (%d)", last_first);
+  RFALSE( nr_src < cpy_num - 1, 
+	  "no so many items (%d) in src (%d)", cpy_num, nr_src);
+  RFALSE( cpy_num < 0, "cpy_num less than 0 (%d)", cpy_num);
+  RFALSE( cpy_num - 1 + B_NR_ITEMS(dest) > (int)MAX_NR_KEY(dest),
+	  "cpy_num (%d) + item number in dest (%d) can not be > MAX_NR_KEY(%d)",
+	  cpy_num, B_NR_ITEMS(dest), MAX_NR_KEY(dest));
 
   if ( cpy_num == 0 )
     return;
@@ -427,23 +400,18 @@ static void internal_insert_key (struct 
     struct block_head * blkh;
     struct key * key;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (dest == NULL || src == NULL)
-	reiserfs_panic (0, "internal_insert_key", "sourse(%p) or dest(%p) buffer is 0", src, dest);
-
-    if (dest_position_before < 0 || src_position < 0)
-	reiserfs_panic (0, "internal_insert_key", "source(%d) or dest(%d) key number less than 0", 
-			src_position, dest_position_before);
-
-    if (dest_position_before > B_NR_ITEMS (dest) || src_position >= B_NR_ITEMS(src))
-	reiserfs_panic (0, "internal_insert_key", 
-			"invalid position in dest (%d (key number %d)) or in src (%d (key number %d))",
-			dest_position_before, B_NR_ITEMS (dest), src_position, B_NR_ITEMS(src));
-
-    if (B_FREE_SPACE (dest) < KEY_SIZE)
-	reiserfs_panic (0, "internal_insert_key", 
-			"no enough free space (%d) in dest buffer", B_FREE_SPACE (dest));
-#endif
+    RFALSE( dest == NULL || src == NULL,
+	    "source(%p) or dest(%p) buffer is 0", src, dest);
+    RFALSE( dest_position_before < 0 || src_position < 0,
+	    "source(%d) or dest(%d) key number less than 0", 
+	    src_position, dest_position_before);
+    RFALSE( dest_position_before > B_NR_ITEMS (dest) || 
+	    src_position >= B_NR_ITEMS(src),
+	    "invalid position in dest (%d (key number %d)) or in src (%d (key number %d))",
+	    dest_position_before, B_NR_ITEMS (dest), 
+	    src_position, B_NR_ITEMS(src));
+    RFALSE( B_FREE_SPACE (dest) < KEY_SIZE,
+	    "no enough free space (%d) in dest buffer", B_FREE_SPACE (dest));
 
     nr = le16_to_cpu ((blkh=B_BLK_HEAD(dest))->blk_nr_item);
 
@@ -557,11 +525,10 @@ static void internal_shift_right (
     /* insert delimiting key from common father of dest and src to dest node into position 0 */
     internal_insert_key (&dest_bi, 0, cf, d_key_position);
     if (nr == pointer_amount - 1) {
-#ifdef CONFIG_REISERFS_CHECK
-      if ( src_bi.bi_bh != PATH_H_PBUFFER (tb->tb_path, h)/*tb->S[h]*/ || dest_bi.bi_bh != tb->R[h])
-	reiserfs_panic (tb->tb_sb, "internal_shift_right", "src (%p) must be == tb->S[h](%p) when it disappears",
-			src_bi.bi_bh, PATH_H_PBUFFER (tb->tb_path, h));
-#endif
+	 RFALSE( src_bi.bi_bh != PATH_H_PBUFFER (tb->tb_path, h)/*tb->S[h]*/ || 
+		 dest_bi.bi_bh != tb->R[h],
+		 "src (%p) must be == tb->S[h](%p) when it disappears",
+		 src_bi.bi_bh, PATH_H_PBUFFER (tb->tb_path, h));
       /* when S[h] disappers replace left delemiting key as well */
       if (tb->CFL[h])
 	replace_key (tb, cf, d_key_position, tb->CFL[h], tb->lkey[h]);
@@ -620,11 +587,8 @@ static void balance_internal_when_delete
 
     internal_delete_childs (&bi, child_pos, -insert_num);
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( tb->blknum[h] > 1 )
-	reiserfs_panic (tb->tb_sb, "balance_internal_when_delete", "tb->blknum[%d]=%d when insert_size < 0",
-			h, tb->blknum[h]);
-#endif /* CONFIG_REISERFS_CHECK */
+    RFALSE( tb->blknum[h] > 1,
+	    "tb->blknum[%d]=%d when insert_size < 0", h, tb->blknum[h]);
 
     n = B_NR_ITEMS(tbSh);
 
@@ -633,14 +597,9 @@ static void balance_internal_when_delete
 	    /* node S[h] (root of the tree) is empty now */
 	    struct buffer_head *new_root;
 
-#ifdef CONFIG_REISERFS_CHECK
-	    if (n || B_FREE_SPACE (tbSh) != MAX_CHILD_SIZE(tbSh) - DC_SIZE)
-		reiserfs_panic (tb->tb_sb, "balance_internal_when_delete", "buffer must have only 0 keys (%d)",
-				n);
-
-	    if (bi.bi_parent)
-		reiserfs_panic (tb->tb_sb, "balance_internal_when_delete", "root has parent (%p)", bi.bi_parent);
-#endif /* CONFIG_REISERFS_CHECK */
+	    RFALSE( n || B_FREE_SPACE (tbSh) != MAX_CHILD_SIZE(tbSh) - DC_SIZE,
+		    "buffer must have only 0 keys (%d)", n);
+	    RFALSE( bi.bi_parent, "root has parent (%p)", bi.bi_parent);
 		
 	    /* choose a new root */
 	    if ( ! tb->L[h-1] || ! B_NR_ITEMS(tb->L[h-1]) )
@@ -669,11 +628,9 @@ static void balance_internal_when_delete
 
     if ( tb->L[h] && tb->lnum[h] == -B_NR_ITEMS(tb->L[h]) - 1 ) { /* join S[h] with L[h] */
 
-#ifdef CONFIG_REISERFS_CHECK
-	if ( tb->rnum[h] != 0 )
-	    reiserfs_panic (tb->tb_sb, "balance_internal_when_delete", "invalid tb->rnum[%d]==%d when joining S[h] with L[h]",
-			    h, tb->rnum[h]);
-#endif /* CONFIG_REISERFS_CHECK */
+	RFALSE( tb->rnum[h] != 0,
+		"invalid tb->rnum[%d]==%d when joining S[h] with L[h]",
+		h, tb->rnum[h]);
 
 	internal_shift_left (INTERNAL_SHIFT_FROM_S_TO_L, tb, h, n + 1);
 	reiserfs_invalidate_buffer(tb, tbSh);
@@ -682,11 +639,9 @@ static void balance_internal_when_delete
     }
 
     if ( tb->R[h] &&  tb->rnum[h] == -B_NR_ITEMS(tb->R[h]) - 1 ) { /* join S[h] with R[h] */
-#ifdef CONFIG_REISERFS_CHECK
-	if ( tb->lnum[h] != 0 )
-	    reiserfs_panic (tb->tb_sb, "balance_internal_when_delete", "invalid tb->lnum[%d]==%d when joining S[h] with R[h]",
-			    h, tb->lnum[h]);
-#endif /* CONFIG_REISERFS_CHECK */
+	RFALSE( tb->lnum[h] != 0,
+		"invalid tb->lnum[%d]==%d when joining S[h] with R[h]",
+		h, tb->lnum[h]);
 
 	internal_shift_right (INTERNAL_SHIFT_FROM_S_TO_R, tb, h, n + 1);
 
@@ -695,33 +650,25 @@ static void balance_internal_when_delete
     }
 
     if ( tb->lnum[h] < 0 ) { /* borrow from left neighbor L[h] */
-#ifdef CONFIG_REISERFS_CHECK
-	if ( tb->rnum[h] != 0 )
-	    reiserfs_panic (tb->tb_sb, "balance_internal_when_delete", "invalid tb->rnum[%d]==%d when borrow from L[h]",
-			    h, tb->rnum[h]);
-#endif /* CONFIG_REISERFS_CHECK */
+	RFALSE( tb->rnum[h] != 0,
+		"wrong tb->rnum[%d]==%d when borrow from L[h]", h, tb->rnum[h]);
 	/*internal_shift_right (tb, h, tb->L[h], tb->CFL[h], tb->lkey[h], tb->S[h], -tb->lnum[h]);*/
 	internal_shift_right (INTERNAL_SHIFT_FROM_L_TO_S, tb, h, -tb->lnum[h]);
 	return;
     }
 
     if ( tb->rnum[h] < 0 ) { /* borrow from right neighbor R[h] */
-#ifdef CONFIG_REISERFS_CHECK
-	if ( tb->lnum[h] != 0 )
-	    reiserfs_panic (tb->tb_sb, "balance_internal_when_delete", "invalid tb->lnum[%d]==%d when borrow from R[h]",
-			    h, tb->lnum[h]);
-#endif /* CONFIG_REISERFS_CHECK */
+	 RFALSE( tb->lnum[h] != 0,
+		 "invalid tb->lnum[%d]==%d when borrow from R[h]", 
+		 h, tb->lnum[h]);
 	internal_shift_left (INTERNAL_SHIFT_FROM_R_TO_S, tb, h, -tb->rnum[h]);/*tb->S[h], tb->CFR[h], tb->rkey[h], tb->R[h], -tb->rnum[h]);*/
 	return;
     }
 
     if ( tb->lnum[h] > 0 ) { /* split S[h] into two parts and put them into neighbors */
-#ifdef CONFIG_REISERFS_CHECK
-	if ( tb->rnum[h] == 0 || tb->lnum[h] + tb->rnum[h] != n + 1 )
-	    reiserfs_panic (tb->tb_sb, "balance_internal_when_delete", 
-			    "invalid tb->lnum[%d]==%d or tb->rnum[%d]==%d when S[h](item number == %d) is split between them",
-			    h, tb->lnum[h], h, tb->rnum[h], n);
-#endif /* CONFIG_REISERFS_CHECK */
+	RFALSE( tb->rnum[h] == 0 || tb->lnum[h] + tb->rnum[h] != n + 1,
+		"invalid tb->lnum[%d]==%d or tb->rnum[%d]==%d when S[h](item number == %d) is split between them",
+		h, tb->lnum[h], h, tb->rnum[h], n);
 
 	internal_shift_left (INTERNAL_SHIFT_FROM_S_TO_L, tb, h, tb->lnum[h]);/*tb->L[h], tb->CFL[h], tb->lkey[h], tb->S[h], tb->lnum[h]);*/
 	internal_shift_right (INTERNAL_SHIFT_FROM_S_TO_R, tb, h, tb->rnum[h]);
@@ -742,11 +689,9 @@ void	replace_lkey (
 		      struct item_head * key
 		      )
 {
-#ifdef CONFIG_REISERFS_CHECK
-  if (tb->L[h] == NULL || tb->CFL[h] == NULL)
-    reiserfs_panic (tb->tb_sb, "replace_lkey: 12255: "
-		    "L[h](%p) and CFL[h](%p) must exist in replace_lkey", tb->L[h], tb->CFL[h]);
-#endif
+   RFALSE( tb->L[h] == NULL || tb->CFL[h] == NULL,
+	   "L[h](%p) and CFL[h](%p) must exist in replace_lkey", 
+	   tb->L[h], tb->CFL[h]);
 
   if (B_NR_ITEMS(PATH_H_PBUFFER(tb->tb_path, h)) == 0)
     return;
@@ -764,15 +709,12 @@ void	replace_rkey (
 		      struct item_head * key
 		      )
 {
-#ifdef CONFIG_REISERFS_CHECK
-  if (tb->R[h] == NULL || tb->CFR[h] == NULL)
-    reiserfs_panic (tb->tb_sb, "replace_rkey: 12260: "
-		    "R[h](%p) and CFR[h](%p) must exist in replace_rkey", tb->R[h], tb->CFR[h]);
-
-  if (B_NR_ITEMS(tb->R[h]) == 0)
-    reiserfs_panic (tb->tb_sb, "replace_rkey: 12265: "
-		    "R[h] can not be empty if it exists (item number=%d)", B_NR_ITEMS(tb->R[h]));
-#endif
+  RFALSE( tb->R[h] == NULL || tb->CFR[h] == NULL,
+	  "R[h](%p) and CFR[h](%p) must exist in replace_rkey", 
+	  tb->R[h], tb->CFR[h]);
+  RFALSE( B_NR_ITEMS(tb->R[h]) == 0,
+	  "R[h] can not be empty if it exists (item number=%d)", 
+	  B_NR_ITEMS(tb->R[h]));
 
   memcpy (B_N_PDELIM_KEY(tb->CFR[h],tb->rkey[h]), key, KEY_SIZE);
 
@@ -810,10 +752,7 @@ int balance_internal (struct tree_balanc
     struct buffer_head * new_insert_ptr = NULL;
     struct item_head * new_insert_key_addr = insert_key;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( h < 1 )      
-	reiserfs_panic (tb->tb_sb, "balance_internal", "h (%d) can not be < 1 on internal level", h);
-#endif /* CONFIG_REISERFS_CHECK */
+    RFALSE( h < 1, "h (%d) can not be < 1 on internal level", h);
 
     order = ( tbSh ) ? PATH_H_POSITION (tb->tb_path, h + 1)/*tb->S[h]->b_item_order*/ : 0;
 
@@ -822,16 +761,12 @@ int balance_internal (struct tree_balanc
     insert_num = tb->insert_size[h]/((int)(KEY_SIZE + DC_SIZE));
 
     /* Check whether insert_num is proper **/
-#ifdef CONFIG_REISERFS_CHECK
-    if ( insert_num < -2  ||  insert_num > 2 )
-	reiserfs_panic (tb->tb_sb, "balance_internal",
-			"incorrect number of items inserted to the internal node (%d)", insert_num);
-
-    if ( h > 1  && (insert_num > 1 || insert_num < -1) )
-	reiserfs_panic (tb->tb_sb, "balance_internal",
-			"incorrect number of items (%d) inserted to the internal node on a level (h=%d) higher than last internal level", 
-			insert_num, h);
-#endif /* CONFIG_REISERFS_CHECK */
+    RFALSE( insert_num < -2  ||  insert_num > 2,
+	    "incorrect number of items inserted to the internal node (%d)", 
+	    insert_num);
+    RFALSE( h > 1  && (insert_num > 1 || insert_num < -1),
+	    "incorrect number of items (%d) inserted to the internal node on a level (h=%d) higher than last internal level", 
+	    insert_num, h);
 
     /* Make balance in case insert_num < 0 */
     if ( insert_num < 0 ) {
@@ -951,19 +886,12 @@ int balance_internal (struct tree_balanc
     }
 
     /** Fill new node that appears instead of S[h] **/
-#ifdef CONFIG_REISERFS_CHECK
-    if ( tb->blknum[h] > 2 )
-	reiserfs_panic(0, "balance_internal", "blknum can not be > 2 for internal level");
-    if ( tb->blknum[h] < 0 )
-	reiserfs_panic(0, "balance_internal", "blknum can not be < 0");
-#endif /* CONFIG_REISERFS_CHECK */
+    RFALSE( tb->blknum[h] > 2, "blknum can not be > 2 for internal level");
+    RFALSE( tb->blknum[h] < 0, "blknum can not be < 0");
 
     if ( ! tb->blknum[h] )
     { /* node S[h] is empty now */
-#ifdef CONFIG_REISERFS_CHECK
-	if ( ! tbSh )
-	    reiserfs_panic(0,"balance_internal", "S[h] is equal NULL");
-#endif /* CONFIG_REISERFS_CHECK */
+	RFALSE( ! tbSh, "S[h] is equal NULL");
 
 	/* do what is needed for buffer thrown from tree */
 	reiserfs_invalidate_buffer(tb,tbSh);
@@ -1081,13 +1009,10 @@ int balance_internal (struct tree_balanc
 	/* new_insert_ptr = node_pointer to S_new */
 	new_insert_ptr = S_new;
 
-#ifdef CONFIG_REISERFS_CHECK
-	if ( buffer_locked(S_new) || atomic_read (&(S_new->b_count)) != 1)
-	    if (buffer_locked(S_new) || atomic_read(&(S_new->b_count)) > 2 ||
-		!(buffer_journaled(S_new) || buffer_journal_dirty(S_new))) {
-		reiserfs_panic (tb->tb_sb, "cm-00001: balance_internal: bad S_new (%b)", S_new);
-	    }
-#endif /* CONFIG_REISERFS_CHECK */
+	RFALSE(( buffer_locked(S_new) || atomic_read (&(S_new->b_count)) != 1) &&
+	       (buffer_locked(S_new) || atomic_read(&(S_new->b_count)) > 2 ||
+		!(buffer_journaled(S_new) || buffer_journal_dirty(S_new))),
+	       "cm-00001: bad S_new (%b)", S_new);
 
 	// S_new is released in unfix_nodes
     }
diff -rup linux-2.4.7-ac1/fs/reiserfs/inode.c linux-2.4.7-ac1.patched/fs/reiserfs/inode.c
--- linux-2.4.7-ac1/fs/reiserfs/inode.c	Fri Jul 27 22:16:49 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/inode.c	Fri Jul 27 22:22:27 2001
@@ -751,11 +751,8 @@ int reiserfs_get_block (struct inode * i
 	    struct cpu_key tmp_key;
 	    struct unfm_nodeinfo un = {0, 0};
 
-#ifdef CONFIG_REISERFS_CHECK
-	    if (pos_in_item != le16_to_cpu (ih->ih_item_len) / UNFM_P_SIZE)
-		reiserfs_panic (inode->i_sb, "vs-: reiserfs_get_block: "
-				"invalid position for append");
-#endif
+	    RFALSE( pos_in_item != le16_to_cpu (ih->ih_item_len) / UNFM_P_SIZE,
+		    "vs-804: invalid position for append");
 	    /* indirect item has to be appended, set up key of that position */
 	    make_cpu_key (&tmp_key, inode,
 			  le_key_k_offset (version, &(ih->ih_key)) + op_bytes_number (ih, inode->i_sb->s_blocksize),
diff -rup linux-2.4.7-ac1/fs/reiserfs/item_ops.c linux-2.4.7-ac1.patched/fs/reiserfs/item_ops.c
--- linux-2.4.7-ac1/fs/reiserfs/item_ops.c	Fri Jul 27 22:16:49 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/item_ops.c	Fri Jul 27 22:22:27 2001
@@ -489,10 +489,8 @@ static inline int old_entry_num (int is_
     if (mode == M_CUT)
 	return virtual_entry_num + 1;
 
-#ifdef CONFIG_REISERFS_CHECK  
-    if (mode != M_PASTE || virtual_entry_num == 0)
-	reiserfs_panic (0, "vs-8015: old_entry_num: mode must be M_PASTE (mode = \'%c\'", mode);
-#endif
+    RFALSE( mode != M_PASTE || virtual_entry_num == 0,
+	    "vs-8015: old_entry_num: mode must be M_PASTE (mode = \'%c\'", mode);
     
     return virtual_entry_num - 1;
 }
diff -rup linux-2.4.7-ac1/fs/reiserfs/journal.c linux-2.4.7-ac1.patched/fs/reiserfs/journal.c
--- linux-2.4.7-ac1/fs/reiserfs/journal.c	Fri Jul 27 22:16:50 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/journal.c	Fri Jul 27 22:22:27 2001
@@ -1998,12 +1998,8 @@ static int do_journal_begin_r(struct rei
   int old_trans_id  ;
 
   reiserfs_check_lock_depth("journal_begin") ;
-#ifdef CONFIG_REISERFS_CHECK
-  if (p_s_sb->s_flags & MS_RDONLY) {
-    printk("clm-2078: calling journal_begin on readonly FS\n") ;
-    BUG() ;
-  }
-#endif
+  RFALSE( p_s_sb->s_flags & MS_RDONLY, 
+	  "clm-2078: calling journal_begin on readonly FS") ;
 
   if (reiserfs_dont_log(p_s_sb)) {
     th->t_super = p_s_sb ; /* others will check this for the don't log flag */
@@ -2641,12 +2637,8 @@ void reiserfs_prepare_for_journal(struct
     }
     set_bit(BH_JPrepared, &bh->b_state) ;
     if (wait) {
-#ifdef CONFIG_REISERFS_CHECK
-      if (buffer_locked(bh) && cur_tb != NULL) {
-	printk("reiserfs_prepare_for_journal, waiting while do_balance was running\n") ;
-        BUG() ;
-      }
-#endif
+      RFALSE( buffer_locked(bh) && cur_tb != NULL,
+	      "waiting while do_balance was running\n") ;
       wait_on_buffer(bh) ;
     }
     retry_count++ ;
diff -rup linux-2.4.7-ac1/fs/reiserfs/lbalance.c linux-2.4.7-ac1.patched/fs/reiserfs/lbalance.c
--- linux-2.4.7-ac1/fs/reiserfs/lbalance.c	Fri Jul 27 22:21:51 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/lbalance.c	Fri Jul 27 22:22:27 2001
@@ -37,10 +37,7 @@ static void leaf_copy_dir_entries (struc
 
     ih = B_N_PITEM_HEAD (source, item_num);
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (!is_direntry_le_ih (ih))
-	reiserfs_panic(0, "vs-10000: leaf_copy_dir_entries: item must be directory item");
-#endif
+    RFALSE( !is_direntry_le_ih (ih), "vs-10000: item must be directory item");
 
     /* length of all record to be copied and first byte of the last of them */
     deh = B_I_DEH (source, ih);
@@ -126,10 +123,7 @@ static int leaf_copy_boundary_item (stru
       /* there is nothing to merge */
       return 0;
       
-#ifdef CONFIG_REISERFS_CHECK
-    if ( ! ih->ih_item_len )
-      reiserfs_panic (0, "vs-10010: leaf_copy_boundary_item: item can not have empty dynamic length");
-#endif
+    RFALSE( ! ih->ih_item_len, "vs-10010: item can not have empty length");
       
     if ( is_direntry_le_ih (ih) ) {
       if ( bytes_or_entries == -1 )
@@ -162,12 +156,9 @@ static int leaf_copy_boundary_item (stru
 			  );
       
     if (is_indirect_le_ih (dih)) {
-#ifdef CONFIG_REISERFS_CHECK
-      if (get_ih_free_space (dih))
-	reiserfs_panic (0, "vs-10030: leaf_copy_boundary_item: " 
-			"merge to left: last unformatted node of non-last indirect item %h must have zerto free space",
-			ih);
-#endif
+      RFALSE( get_ih_free_space (dih),
+	      "vs-10030: merge to left: last unformatted node of non-last indirect item %h must have zero free space", 
+	      ih);
       if (bytes_or_entries == le16_to_cpu (ih->ih_item_len))
 	set_ih_free_space (dih, get_ih_free_space (ih));
     }
@@ -202,21 +193,17 @@ static int leaf_copy_boundary_item (stru
      don't create new item header
      */
   
-#ifdef CONFIG_REISERFS_CHECK  
-  if (is_indirect_le_ih(ih) && get_ih_free_space (ih))
-    reiserfs_panic (0, "vs-10040: leaf_copy_boundary_item: " 
-		    "merge to right: last unformatted node of non-last indirect item must be filled entirely (%h)",
+  RFALSE( is_indirect_le_ih(ih) && get_ih_free_space (ih),
+	  "vs-10040: merge to right: last unformatted node of non-last indirect item must be filled entirely (%h)",
 		    ih);
-#endif
 
   if ( bytes_or_entries == -1 ) {
     /* bytes_or_entries = length of last item body of SOURCE */
     bytes_or_entries = ih->ih_item_len;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (le_ih_k_offset (dih) != le_ih_k_offset (ih) + op_bytes_number (ih, src->b_size))
-      reiserfs_panic (0, "vs-10050: leaf_copy_boundary_item: items %h and %h do not match", ih, dih);
-#endif
+    RFALSE( le_ih_k_offset (dih) != 
+	    le_ih_k_offset (ih) + op_bytes_number (ih, src->b_size),
+	    "vs-10050: items %h and %h do not match", ih, dih);
 
     /* change first item key of the DEST */
     set_le_ih_k_offset (dih, le_ih_k_offset (ih));
@@ -226,26 +213,20 @@ static int leaf_copy_boundary_item (stru
     set_le_ih_k_type (dih, le_ih_k_type (ih));
   } else {
     /* merge to right only part of item */
-#ifdef CONFIG_REISERFS_CHECK
-    if ( le16_to_cpu (ih->ih_item_len) <= bytes_or_entries )
-      reiserfs_panic (0, "vs-10060: leaf_copy_boundary_item: no so much bytes %lu (needed %lu)",
-		      ih->ih_item_len, bytes_or_entries);
-#endif
+    RFALSE( le16_to_cpu (ih->ih_item_len) <= bytes_or_entries,
+	    "vs-10060: no so much bytes %lu (needed %lu)",
+	    ih->ih_item_len, bytes_or_entries);
     
     /* change first item key of the DEST */
     if ( is_direct_le_ih (dih) ) {
-#ifdef CONFIG_REISERFS_CHECK
-      if (le_ih_k_offset (dih) <= (unsigned long)bytes_or_entries)
-	reiserfs_panic (0, "vs-10070: leaf_copy_boundary_item: dih %h, bytes_or_entries(%d)", 
-			dih, bytes_or_entries);
-#endif
+      RFALSE( le_ih_k_offset (dih) <= (unsigned long)bytes_or_entries,
+	      "vs-10070: dih %h, bytes_or_entries(%d)", dih, bytes_or_entries);
       set_le_ih_k_offset (dih, le_ih_k_offset (dih) - bytes_or_entries);
     } else {
-#ifdef CONFIG_REISERFS_CHECK
-      if (le_ih_k_offset (dih) <= (bytes_or_entries / UNFM_P_SIZE) * dest->b_size )
-	reiserfs_panic (0, "vs-10080: leaf_copy_boundary_item: dih %h, bytes_or_entries(%d)",
-			dih, (bytes_or_entries/UNFM_P_SIZE)*dest->b_size);
-#endif
+      RFALSE( le_ih_k_offset (dih) <= 
+	      (bytes_or_entries / UNFM_P_SIZE) * dest->b_size,
+	      "vs-10080: dih %h, bytes_or_entries(%d)",
+	      dih, (bytes_or_entries/UNFM_P_SIZE)*dest->b_size);
       set_le_ih_k_offset (dih, le_ih_k_offset (dih) - ((bytes_or_entries / UNFM_P_SIZE) * dest->b_size));
     }
   }
@@ -270,27 +251,17 @@ static void leaf_copy_items_entirely (st
     struct block_head * blkh;
     struct item_head * ih;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (last_first != LAST_TO_FIRST  && last_first != FIRST_TO_LAST) 
-	reiserfs_panic (0, "vs-10090: leaf_copy_items_entirely: bad last_first parameter %d", last_first);
-
-    if (B_NR_ITEMS (src) - first < cpy_num)
-	reiserfs_panic (0, "vs-10100: leaf_copy_items_entirely: too few items in source %d, required %d from %d",
-			B_NR_ITEMS(src), cpy_num, first);
-
-    if (cpy_num < 0)
-	reiserfs_panic (0, "vs-10110: leaf_copy_items_entirely: can not copy negative amount of items");
-
-    if ( ! dest_bi )
-	reiserfs_panic (0, "vs-10120: leaf_copy_items_entirely: can not copy negative amount of items");
-#endif
+    RFALSE( last_first != LAST_TO_FIRST  && last_first != FIRST_TO_LAST,
+	    "vs-10090: bad last_first parameter %d", last_first);
+    RFALSE( B_NR_ITEMS (src) - first < cpy_num,
+	    "vs-10100: too few items in source %d, required %d from %d",
+	    B_NR_ITEMS(src), cpy_num, first);
+    RFALSE( cpy_num < 0, "vs-10110: can not copy negative amount of items");
+    RFALSE( ! dest_bi, "vs-10120: can not copy negative amount of items");
 
     dest = dest_bi->bi_bh;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( ! dest )
-	reiserfs_panic (0, "vs-10130: leaf_copy_items_entirely: can not copy negative amount of items");
-#endif
+    RFALSE( ! dest, "vs-10130: can not copy negative amount of items");
 
     if (cpy_num == 0)
 	return;
@@ -303,13 +274,9 @@ static void leaf_copy_items_entirely (st
     /* location of head of first new item */
     ih = B_N_PITEM_HEAD (dest, dest_before);
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (le16_to_cpu (blkh->blk_free_space) < cpy_num * IH_SIZE) {
-	reiserfs_panic (0, "vs-10140: leaf_copy_items_entirely: "
-			"not enough free space for headers %d (needed %d)",
-			B_FREE_SPACE (dest), cpy_num * IH_SIZE);
-    }
-#endif
+    RFALSE( le16_to_cpu (blkh->blk_free_space) < cpy_num * IH_SIZE,
+	    "vs-10140: not enough free space for headers %d (needed %d)",
+	    B_FREE_SPACE (dest), cpy_num * IH_SIZE);
 
     /* prepare space for headers */
     memmove (ih + cpy_num, ih, (nr-dest_before) * IH_SIZE);
@@ -330,12 +297,9 @@ static void leaf_copy_items_entirely (st
     last_inserted_loc = ih[cpy_num-1].ih_item_location;
 
     /* check free space */
-#ifdef CONFIG_REISERFS_CHECK
-    if (le16_to_cpu (blkh->blk_free_space) < j - last_inserted_loc) {
-	reiserfs_panic (0, "vs-10150: leaf_copy_items_entirely: not enough free space for items %d (needed %d)",
-			le16_to_cpu (blkh->blk_free_space), j - last_inserted_loc);
-    }
-#endif
+    RFALSE( le16_to_cpu (blkh->blk_free_space) < j - last_inserted_loc,
+	    "vs-10150: not enough free space for items %d (needed %d)",
+	    le16_to_cpu (blkh->blk_free_space), j - last_inserted_loc);
 
     memmove (dest->b_data + last_loc,
 	     dest->b_data + last_loc + j - last_inserted_loc,
@@ -352,13 +316,9 @@ static void leaf_copy_items_entirely (st
     do_balance_mark_leaf_dirty (dest_bi->tb, dest, 0);
 
     if (dest_bi->bi_parent) {
-#ifdef CONFIG_REISERFS_CHECK
-	if (B_N_CHILD (dest_bi->bi_parent, dest_bi->bi_position)->dc_block_number != dest->b_blocknr) {
-	    reiserfs_panic (0, "vs-10160: leaf_copy_items_entirely: "
-			    "block number in bh does not match to field in disk_child structure %lu and %lu",
-			    dest->b_blocknr, B_N_CHILD (dest_bi->bi_parent, dest_bi->bi_position)->dc_block_number);
-	}
-#endif
+	RFALSE( B_N_CHILD (dest_bi->bi_parent, dest_bi->bi_position)->dc_block_number != dest->b_blocknr,
+		"vs-10160: block number in bh does not match to field in disk_child structure %lu and %lu",
+		dest->b_blocknr, B_N_CHILD (dest_bi->bi_parent, dest_bi->bi_position)->dc_block_number);
 	B_N_CHILD (dest_bi->bi_parent, dest_bi->bi_position)->dc_size +=
 	    j - last_inserted_loc + IH_SIZE * cpy_num;
     
@@ -375,10 +335,7 @@ static void leaf_item_bottle (struct buf
     struct buffer_head * dest = dest_bi->bi_bh;
     struct item_head * ih;
   
-#ifdef CONFIG_REISERFS_CHECK  
-    if ( cpy_bytes == -1 ) 
-	reiserfs_panic (0, "vs-10170: leaf_item_bottle: bytes == - 1 means: do not split item");
-#endif
+    RFALSE( cpy_bytes == -1, "vs-10170: bytes == - 1 means: do not split item");
 
     if ( last_first == FIRST_TO_LAST ) {
 	/* if ( if item in position item_num in buffer SOURCE is directory item ) */
@@ -394,19 +351,15 @@ static void leaf_item_bottle (struct buf
 	    memcpy (&n_ih, ih, IH_SIZE);
 	    n_ih.ih_item_len = cpu_to_le16 (cpy_bytes);
 	    if (is_indirect_le_ih (ih)) {
-#ifdef CONFIG_REISERFS_CHECK
-		if (cpy_bytes == le16_to_cpu (ih->ih_item_len) && get_ih_free_space (ih))
-		    reiserfs_panic (0, "vs-10180: leaf_item_bottle: " 
-				    "when whole indirect item is bottle to left neighbor, it must have free_space==0 (not %lu)",
-				    get_ih_free_space (ih));
-#endif
+		RFALSE( cpy_bytes == le16_to_cpu (ih->ih_item_len) && 
+			get_ih_free_space (ih),
+			"vs-10180: when whole indirect item is bottle to left neighbor, it must have free_space==0 (not %lu)",
+			get_ih_free_space (ih));
 		set_ih_free_space (&n_ih, 0);
 	    }
 
-#ifdef CONFIG_REISERFS_CHECK
-	    if (op_is_left_mergeable (&(ih->ih_key), src->b_size))
-		reiserfs_panic (0, "vs-10190: leaf_item_bottle: bad mergeability of item %h", ih);
-#endif
+	    RFALSE( op_is_left_mergeable (&(ih->ih_key), src->b_size),
+		    "vs-10190: bad mergeability of item %h", ih);
 	    n_ih.ih_version = ih->ih_version;;
 	    leaf_insert_into_buf (dest_bi, B_NR_ITEMS(dest), &n_ih, B_N_PITEM (src, item_num), 0);
 	}
@@ -429,10 +382,8 @@ static void leaf_item_bottle (struct buf
 		set_ih_free_space (&n_ih, MAX_US_INT);
 	    } else {
 		/* indirect item */
-#ifdef CONFIG_REISERFS_CHECK
-		if (!cpy_bytes && get_ih_free_space (ih))
-		    reiserfs_panic (0, "vs-10200: leaf_item_bottle: ih->ih_free_space must be 0 when indirect item will be appended");
-#endif
+		RFALSE( !cpy_bytes && get_ih_free_space (ih),
+			"vs-10200: ih->ih_free_space must be 0 when indirect item will be appended");
 		set_le_ih_k_offset (&n_ih, le_ih_k_offset (ih) + (le16_to_cpu (ih->ih_item_len) - cpy_bytes) / UNFM_P_SIZE * dest->b_size);
 		set_le_ih_k_type (&n_ih, TYPE_INDIRECT);
 		set_ih_free_space (&n_ih, get_ih_free_space (ih));
@@ -458,19 +409,12 @@ static int leaf_copy_items (struct buffe
   int pos, i, src_nr_item, bytes;
 
   dest = dest_bi->bi_bh;
-#ifdef CONFIG_REISERFS_CHECK
-  if (!dest || !src)
-    reiserfs_panic (0, "vs-10210: leaf_copy_items: !dest || !src");
-  
-  if ( last_first != FIRST_TO_LAST && last_first != LAST_TO_FIRST )
-    reiserfs_panic (0, "vs-10220: leaf_copy_items: last_first != FIRST_TO_LAST && last_first != LAST_TO_FIRST");
-
-  if ( B_NR_ITEMS(src) < cpy_num )
-    reiserfs_panic (0, "vs-10230: leaf_copy_items: No enough items: %d, required %d", B_NR_ITEMS(src), cpy_num);
-
- if ( cpy_num < 0 )
-    reiserfs_panic (0, "vs-10240: leaf_copy_items: cpy_num < 0 (%d)", cpy_num);
-#endif
+  RFALSE( !dest || !src, "vs-10210: !dest || !src");
+  RFALSE( last_first != FIRST_TO_LAST && last_first != LAST_TO_FIRST,
+	  "vs-10220:last_first != FIRST_TO_LAST && last_first != LAST_TO_FIRST");
+  RFALSE( B_NR_ITEMS(src) < cpy_num,
+	  "vs-10230: No enough items: %d, req. %d", B_NR_ITEMS(src), cpy_num);
+  RFALSE( cpy_num < 0,"vs-10240: cpy_num < 0 (%d)", cpy_num);
 
  if ( cpy_num == 0 )
    return 0;
@@ -537,10 +481,8 @@ static void leaf_define_dest_src_infos (
 					struct buffer_info * src_bi, int * first_last,
 					struct buffer_head * Snew)
 {
-#ifdef CONFIG_REISERFS_CHECK
     memset (dest_bi, 0, sizeof (struct buffer_info));
     memset (src_bi, 0, sizeof (struct buffer_info));
-#endif
 
     /* define dest, src, dest parent, dest position */
     switch (shift_mode) {
@@ -607,12 +549,9 @@ static void leaf_define_dest_src_infos (
     default:
 	reiserfs_panic (0, "vs-10250: leaf_define_dest_src_infos: shift type is unknown (%d)", shift_mode);
     }
-#ifdef CONFIG_REISERFS_CHECK
-    if (src_bi->bi_bh == 0 || dest_bi->bi_bh == 0) {
-	reiserfs_panic (0, "vs-10260: leaf_define_dest_src_etc: mode==%d, source (%p) or dest (%p) buffer is initialized incorrectly",
-			shift_mode, src_bi->bi_bh, dest_bi->bi_bh);
-    }
-#endif
+    RFALSE( src_bi->bi_bh == 0 || dest_bi->bi_bh == 0,
+	    "vs-10260: mode==%d, source (%p) or dest (%p) buffer is initialized incorrectly",
+	    shift_mode, src_bi->bi_bh, dest_bi->bi_bh);
 }
 
 
@@ -650,10 +589,10 @@ int leaf_shift_left (struct tree_balance
   if ( shift_num ) {
     if (B_NR_ITEMS (S0) == 0) { /* number of items in S[0] == 0 */
 
+      RFALSE( shift_bytes != -1,
+	      "vs-10270: S0 is empty now, but shift_bytes != -1 (%d)", 
+	      shift_bytes);
 #ifdef CONFIG_REISERFS_CHECK
-      if ( shift_bytes != -1 )
-	reiserfs_panic (tb->tb_sb, "vs-10270: leaf_shift_left: S0 is empty now, but shift_bytes != -1 (%d)", shift_bytes);
-
       if (tb->tb_mode == M_PASTE || tb->tb_mode == M_INSERT) {
 	print_cur_tb ("vs-10275");
 	reiserfs_panic (tb->tb_sb, "vs-10275: leaf_shift_left: balance condition corrupted (%c)", tb->tb_mode);
@@ -675,14 +614,11 @@ int leaf_shift_left (struct tree_balance
       /* change right_delimiting_key field in L0's block header */
       copy_key (B_PRIGHT_DELIM_KEY(tb->L[0]), B_N_PKEY (S0, 0));
 #endif
-#ifdef CONFIG_REISERFS_CHECK
-      if (shift_bytes != -1 && !(is_direntry_le_ih (B_N_PITEM_HEAD (S0, 0))
-				 && !I_ENTRY_COUNT (B_N_PITEM_HEAD (S0, 0)))) {
-	if (!op_is_left_mergeable (B_N_PKEY (S0, 0), S0->b_size)) {
-	  reiserfs_panic (tb->tb_sb, "vs-10280: leaf_shift_left: item must be mergeable");
-	}
-      }
-#endif
+      RFALSE( (shift_bytes != -1 && 
+	       !(is_direntry_le_ih (B_N_PITEM_HEAD (S0, 0))
+		 && !I_ENTRY_COUNT (B_N_PITEM_HEAD (S0, 0)))) &&
+	      (!op_is_left_mergeable (B_N_PKEY (S0, 0), S0->b_size)),
+	      "vs-10280: item must be mergeable");
     }
   }
   
@@ -741,17 +677,12 @@ void leaf_delete_items (struct buffer_in
     struct buffer_head * bh;
     int item_amount = B_NR_ITEMS (bh = cur_bi->bi_bh);
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( !bh )
-	reiserfs_panic (0, "leaf_delete_items: 10155: bh is not defined");
-
-    if ( del_num < 0 )
-	reiserfs_panic (0, "leaf_delete_items: 10160: del_num can not be < 0. del_num==%d", del_num);
-
-    if ( first < 0 || first + del_num > item_amount )
-	reiserfs_panic (0, "leaf_delete_items: 10165: invalid number of first item to be deleted (%d) or "
-			"no so much items (%d) to delete (only %d)", first, first + del_num, item_amount);
-#endif
+    RFALSE( !bh, "10155: bh is not defined");
+    RFALSE( del_num < 0, "10160: del_num can not be < 0. del_num==%d", del_num);
+    RFALSE( first < 0 || first + del_num > item_amount,
+	    "10165: invalid number of first item to be deleted (%d) or "
+	    "no so much items (%d) to delete (only %d)", 
+	    first, first + del_num, item_amount);
 
     if ( del_num == 0 )
 	return;
@@ -814,16 +745,14 @@ void leaf_insert_into_buf (struct buffer
 
     nr = le16_to_cpu ((blkh = B_BLK_HEAD (bh))->blk_nr_item);
 
-#ifdef CONFIG_REISERFS_CHECK
     /* check free space */
-    if (le16_to_cpu (blkh->blk_free_space) < le16_to_cpu (inserted_item_ih->ih_item_len) + IH_SIZE)
-	reiserfs_panic (0, "leaf_insert_into_buf: 10170: "
-			"not enough free space in block %z, new item %h",
-			bh, inserted_item_ih);
-    if (zeros_number > inserted_item_ih->ih_item_len)
-	reiserfs_panic (0, "vs-10172: leaf_insert_into_buf: "
-			"zero number == %d, item length == %d", zeros_number, inserted_item_ih->ih_item_len);
-#endif /* CONFIG_REISERFS_CHECK */
+    RFALSE( le16_to_cpu (blkh->blk_free_space) < 
+	    le16_to_cpu (inserted_item_ih->ih_item_len) + IH_SIZE,
+	    "not enough free space in block %z, new item %h",
+	    bh, inserted_item_ih);
+    RFALSE( zeros_number > inserted_item_ih->ih_item_len,
+	    "vs-10172: zero number == %d, item length == %d", 
+	    zeros_number, inserted_item_ih->ih_item_len);
 
 
     /* get item new item must be inserted before */
@@ -886,11 +815,11 @@ void leaf_paste_in_buffer (struct buffer
 
     nr = le16_to_cpu ((blkh = B_BLK_HEAD(bh))->blk_nr_item);
 
-#ifdef CONFIG_REISERFS_CHECK
     /* check free space */
-    if (le16_to_cpu (blkh->blk_free_space) < paste_size)
-	reiserfs_panic (0, "leaf_paste_in_buffer: 10175: not enough free space: needed %d, available %d",
-			paste_size, le16_to_cpu (blkh->blk_free_space));
+    RFALSE( le16_to_cpu (blkh->blk_free_space) < paste_size,
+	    "10175: not enough free space: needed %d, available %d",
+	    paste_size, le16_to_cpu (blkh->blk_free_space));
+#ifdef CONFIG_REISERFS_CHECK
     if (zeros_number > paste_size) {
 	print_cur_tb ("10177");
 	reiserfs_panic (0, "vs-10177: leaf_paste_in_buffer: zero number == %d, paste_size == %d",
@@ -965,16 +894,12 @@ static int	leaf_cut_entries (
   int i;
 
 
-#ifdef CONFIG_REISERFS_CHECK
   /* make sure, that item is directory and there are enough entries to
      remove */
-  if (!is_direntry_le_ih (ih))
-    reiserfs_panic (0, "leaf_cut_entries: 10180: item is not directory item");
-
-  if (I_ENTRY_COUNT(ih) < from + del_count)
-    reiserfs_panic (0, "leaf_cut_entries: 10185: item contains not enough entries: entry_cout = %d, from = %d, to delete = %d",
-		    I_ENTRY_COUNT(ih), from, del_count);
-#endif
+  RFALSE( !is_direntry_le_ih (ih), "10180: item is not directory item");
+  RFALSE( I_ENTRY_COUNT(ih) < from + del_count,
+	  "10185: item contains not enough entries: entry_cout = %d, from = %d, to delete = %d",
+	  I_ENTRY_COUNT(ih), from, del_count);
 
   if (del_count == 0)
     return 0;
@@ -1042,25 +967,19 @@ void leaf_cut_from_buffer (struct buffer
         cut_size = leaf_cut_entries (bh, ih, pos_in_item, cut_size);
         if (pos_in_item == 0) {
 	        /* change key */
-#ifdef CONFIG_REISERFS_CHECK
-            if (cut_item_num)
-                reiserfs_panic (0, "leaf_cut_from_buffer: 10190: " 
+	    RFALSE( cut_item_num,
                     "when 0-th enrty of item is cut, that item must be first in the node, not %d-th", cut_item_num);
-#endif
             /* change item key by key of first entry in the item */
 	    set_le_ih_k_offset (ih, le32_to_cpu (B_I_DEH (bh, ih)->deh_offset));
             /*memcpy (&ih->ih_key.k_offset, &(B_I_DEH (bh, ih)->deh_offset), SHORT_KEY_SIZE);*/
 	    }
     } else {
         /* item is direct or indirect */
-#ifdef CONFIG_REISERFS_CHECK
-        if (is_statdata_le_ih (ih))
-	        reiserfs_panic (0, "leaf_cut_from_buffer: 10195: item is stat data");
-
-        if (pos_in_item && pos_in_item + cut_size != le16_to_cpu (ih->ih_item_len) )
-            reiserfs_panic (0, "cut_from_buf: 10200: invalid offset (%lu) or trunc_size (%lu) or ih_item_len (%lu)",
+	RFALSE( is_statdata_le_ih (ih), "10195: item is stat data");
+	RFALSE( pos_in_item && 
+		pos_in_item + cut_size != le16_to_cpu (ih->ih_item_len),
+		"invalid offset (%lu) or trunc_size (%lu) or ih_item_len (%lu)",
                 pos_in_item, cut_size, le16_to_cpu (ih->ih_item_len));
-#endif
 
         /* shift item body to left if cut is from the head of item */
         if (pos_in_item == 0) {
@@ -1072,10 +991,9 @@ void leaf_cut_from_buffer (struct buffer
 		set_le_ih_k_offset (ih, le_ih_k_offset (ih) + cut_size);
             else {
 		set_le_ih_k_offset (ih, le_ih_k_offset (ih) + (cut_size / UNFM_P_SIZE) * bh->b_size);
-#ifdef CONFIG_REISERFS_CHECK
-                if ( le16_to_cpu (ih->ih_item_len) == cut_size && get_ih_free_space (ih) )
-                    reiserfs_panic (0, "leaf_cut_from_buf: 10205: invalid ih_free_space (%h)", ih);
-#endif
+		RFALSE( le16_to_cpu (ih->ih_item_len) == cut_size && 
+			get_ih_free_space (ih),
+			"10205: invalid ih_free_space (%h)", ih);
 	        }
 	    }
     }
@@ -1130,23 +1048,16 @@ static void leaf_delete_items_entirely (
     struct block_head * blkh;
     struct item_head * ih;
 
-#ifdef CONFIG_REISERFS_CHECK
-  if (bh == NULL)
-    reiserfs_panic (0, "leaf_delete_items_entirely: 10210: buffer is 0");
-
-  if (del_num < 0)
-    reiserfs_panic (0, "leaf_delete_items_entirely: 10215: del_num less than 0 (%d)", del_num);
-#endif /* CONFIG_REISERFS_CHECK */
+  RFALSE( bh == NULL, "10210: buffer is 0");
+  RFALSE( del_num < 0, "10215: del_num less than 0 (%d)", del_num);
 
   if (del_num == 0)
     return;
 
   nr = le16_to_cpu ((blkh = B_BLK_HEAD(bh))->blk_nr_item);
 
-#ifdef CONFIG_REISERFS_CHECK
-  if (first < 0 || first + del_num > nr)
-    reiserfs_panic (0, "leaf_delete_items_entirely: 10220: first=%d, number=%d, there is %d items", first, del_num, nr);
-#endif /* CONFIG_REISERFS_CHECK */
+  RFALSE( first < 0 || first + del_num > nr,
+	  "10220: first=%d, number=%d, there is %d items", first, del_num, nr);
 
   if (first == 0 && del_num == nr) {
     /* this does not work */
@@ -1213,15 +1124,11 @@ void    leaf_paste_entries (
 
     ih = B_N_PITEM_HEAD(bh, item_num);
 
-#ifdef CONFIG_REISERFS_CHECK
   /* make sure, that item is directory, and there are enough records in it */
-  if (!is_direntry_le_ih (ih))
-    reiserfs_panic (0, "leaf_paste_entries: 10225: item is not directory item");
-
-  if (I_ENTRY_COUNT (ih) < before)
-    reiserfs_panic (0, "leaf_paste_entries: 10230: there are no entry we paste entries before. entry_count = %d, before = %d",
-		    I_ENTRY_COUNT (ih), before);
-#endif
+  RFALSE( !is_direntry_le_ih (ih), "10225: item is not directory item");
+  RFALSE( I_ENTRY_COUNT (ih) < before,
+	  "10230: there are no entry we paste entries before. entry_count = %d, before = %d",
+	  I_ENTRY_COUNT (ih), before);
 
 
   /* first byte of dest item */
@@ -1268,13 +1175,6 @@ void    leaf_paste_entries (
   /* change item key if neccessary (when we paste before 0-th entry */
   if (!before)
     {
-#ifdef CONFIG_REISERFS_CHECK
-/*
-      if ( old_entry_num && COMP_SHORT_KEYS ((unsigned long *)&ih->ih_key.k_offset,
-					     &(new_dehs->deh_offset)) <= 0)
-	reiserfs_panic (0, "leaf_paste_entries: 10235: new key must be less, that old key");
-*/
-#endif
 	set_le_ih_k_offset (ih, le32_to_cpu (new_dehs->deh_offset));
 /*      memcpy (&ih->ih_key.k_offset, 
 		       &new_dehs->deh_offset, SHORT_KEY_SIZE);*/
diff -rup linux-2.4.7-ac1/fs/reiserfs/namei.c linux-2.4.7-ac1.patched/fs/reiserfs/namei.c
--- linux-2.4.7-ac1/fs/reiserfs/namei.c	Fri Jul 27 22:16:50 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/namei.c	Fri Jul 27 22:22:27 2001
@@ -245,10 +245,8 @@ static int linear_search_in_dir_item (st
 	i --;
     }
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (de->de_deh != B_I_DEH (de->de_bh, de->de_ih))
-	reiserfs_panic (0, "vs-7010: linear_search_in_dir_item: array of entry headers not found");
-#endif /* CONFIG_REISERFS_CHECK */
+    RFALSE( de->de_deh != B_I_DEH (de->de_bh, de->de_ih),
+	    "vs-7010: array of entry headers not found");
 
     deh += i;
 
@@ -290,11 +288,8 @@ static int linear_search_in_dir_item (st
 	// so, this is a bug
 	return NAME_NOT_FOUND;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if (de->de_item_num)
-	reiserfs_panic (0, "vs-7015: linear_search_in_dir_item: "
-			"two diritems of the same directory in one node?");
-#endif /* CONFIG_REISERFS_CHECK */
+    RFALSE( de->de_item_num,
+	    "vs-7015: two diritems of the same directory in one node?");
 
     return GOTO_PREVIOUS_ITEM;
 }
@@ -1149,14 +1144,9 @@ int reiserfs_rename (struct inode * old_
 	    continue;
 	}
 
-#ifdef CONFIG_REISERFS_CHECK
-	if (S_ISDIR(old_inode->i_mode) && 
-	    (!entry_points_to_object ("..", 2, &dot_dot_de, old_dir) || 
-	     !reiserfs_buffer_prepared(dot_dot_de.de_bh))) {
-	    // this should be not changed
-	    BUG ();
-	}
-#endif	
+	RFALSE( S_ISDIR(old_inode->i_mode) && 
+		(!entry_points_to_object ("..", 2, &dot_dot_de, old_dir) || 
+		 !reiserfs_buffer_prepared(dot_dot_de.de_bh)), "" );
 
 	break;
     }
diff -rup linux-2.4.7-ac1/fs/reiserfs/objectid.c linux-2.4.7-ac1.patched/fs/reiserfs/objectid.c
--- linux-2.4.7-ac1/fs/reiserfs/objectid.c	Fri Jul 27 22:16:50 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/objectid.c	Fri Jul 27 22:22:27 2001
@@ -26,6 +26,9 @@ static void check_objectid_map (struct s
     // FIXME: add something else here
 }
 
+#else
+static void check_objectid_map (struct super_block * s, __u32 * map)
+{;}
 #endif
 
 
@@ -53,9 +56,7 @@ __u32 reiserfs_get_unused_objectid (stru
     __u32 unused_objectid;
 
 
-#ifdef CONFIG_REISERFS_CHECK
     check_objectid_map (s, map);
-#endif
 
     reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), 1) ;
                                 /* comment needed -Hans */
@@ -101,9 +102,7 @@ void reiserfs_release_objectid (struct r
     int i = 0;
 
     //return;
-#ifdef CONFIG_REISERFS_CHECK
     check_objectid_map (s, map);
-#endif
 
     reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), 1) ;
     journal_mark_dirty(th, s, SB_BUFFER_WITH_SB (s)); 
@@ -129,13 +128,10 @@ void reiserfs_release_objectid (struct r
 		//disk_sb->s_oid_cursize -= 2;
 		rs->s_oid_cursize = cpu_to_le16 (le16_to_cpu (rs->s_oid_cursize) - 2);
 
-#ifdef CONFIG_REISERFS_CHECK
-		if (le16_to_cpu (rs->s_oid_cursize) < 2 || 
-		    le16_to_cpu (rs->s_oid_cursize) > le16_to_cpu (rs->s_oid_maxsize))
-		    reiserfs_panic (s, "vs-15005: reiserfs_release_objectid: "
-				    "objectid map corrupted cur_size == %d (max == %d)",
-				    le16_to_cpu (rs->s_oid_cursize), le16_to_cpu (rs->s_oid_maxsize));
-#endif
+		RFALSE( le16_to_cpu (rs->s_oid_cursize) < 2 || 
+			le16_to_cpu (rs->s_oid_cursize) > le16_to_cpu (rs->s_oid_maxsize),
+			"vs-15005: objectid map corrupted cur_size == %d (max == %d)",
+			le16_to_cpu (rs->s_oid_cursize), le16_to_cpu (rs->s_oid_maxsize));
 	    }
 	    return;
 	}
diff -rup linux-2.4.7-ac1/fs/reiserfs/stree.c linux-2.4.7-ac1.patched/fs/reiserfs/stree.c
--- linux-2.4.7-ac1/fs/reiserfs/stree.c	Fri Jul 27 22:16:50 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/stree.c	Fri Jul 27 22:22:27 2001
@@ -65,13 +65,8 @@
 inline int B_IS_IN_TREE (struct buffer_head * p_s_bh)
 {
 
-#ifdef CONFIG_REISERFS_CHECK
-
-  if ( B_LEVEL (p_s_bh) > MAX_HEIGHT ) {
-    reiserfs_panic(0, "PAP-1010: B_IS_IN_TREE: block (%b) has too big level (%z)",
-		   p_s_bh, p_s_bh);
-  }
-#endif
+  RFALSE( B_LEVEL (p_s_bh) > MAX_HEIGHT,
+	  "PAP-1010: block (%b) has too big level (%z)", p_s_bh, p_s_bh);
 
   return ( B_LEVEL (p_s_bh) != FREE_LEVEL );
 }
@@ -312,18 +307,14 @@ inline	struct  key * get_lkey  (
   int                   n_position, n_path_offset = p_s_chk_path->path_length;
   struct buffer_head  * p_s_parent;
   
-#ifdef CONFIG_REISERFS_CHECK
-  if ( n_path_offset < FIRST_PATH_ELEMENT_OFFSET )
-    reiserfs_panic(p_s_sb,"PAP-5010: get_lkey: illegal offset in the path");
-#endif
+  RFALSE( n_path_offset < FIRST_PATH_ELEMENT_OFFSET, 
+	  "PAP-5010: illegal offset in the path");
 
   /* While not higher in path than first element. */
   while ( n_path_offset-- > FIRST_PATH_ELEMENT_OFFSET ) {
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( ! buffer_uptodate(PATH_OFFSET_PBUFFER(p_s_chk_path, n_path_offset)) )
-      reiserfs_panic(p_s_sb, "PAP-5020: get_lkey: parent is not uptodate");
-#endif
+    RFALSE( ! buffer_uptodate(PATH_OFFSET_PBUFFER(p_s_chk_path, n_path_offset)),
+	    "PAP-5020: parent is not uptodate");
 
     /* Parent at the path is not in the tree now. */
     if ( ! B_IS_IN_TREE(p_s_parent = PATH_OFFSET_PBUFFER(p_s_chk_path, n_path_offset)) )
@@ -356,17 +347,13 @@ inline	struct  key * get_rkey  (
     			n_path_offset = p_s_chk_path->path_length;
   struct buffer_head  * p_s_parent;
 
-#ifdef CONFIG_REISERFS_CHECK
-  if ( n_path_offset < FIRST_PATH_ELEMENT_OFFSET )
-    reiserfs_panic(p_s_sb,"PAP-5030: get_rkey: illegal offset in the path");
-#endif
+  RFALSE( n_path_offset < FIRST_PATH_ELEMENT_OFFSET,
+	  "PAP-5030: illegal offset in the path");
 
   while ( n_path_offset-- > FIRST_PATH_ELEMENT_OFFSET ) {
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( ! buffer_uptodate(PATH_OFFSET_PBUFFER(p_s_chk_path, n_path_offset)) )
-      reiserfs_panic(p_s_sb, "PAP-5040: get_rkey: parent is not uptodate");
-#endif
+    RFALSE( ! buffer_uptodate(PATH_OFFSET_PBUFFER(p_s_chk_path, n_path_offset)),
+	    "PAP-5040: parent is not uptodate");
 
     /* Parent at the path is not in the tree now. */
     if ( ! B_IS_IN_TREE(p_s_parent = PATH_OFFSET_PBUFFER(p_s_chk_path, n_path_offset)) )
@@ -401,15 +388,12 @@ static  inline  int key_in_buffer (
                       struct super_block  * p_s_sb        /* Super block pointer.           */
 		      ) {
 
-#ifdef CONFIG_REISERFS_CHECK
-  if ( ! p_s_key || p_s_chk_path->path_length < FIRST_PATH_ELEMENT_OFFSET ||
-       p_s_chk_path->path_length > MAX_HEIGHT )
-    reiserfs_panic(p_s_sb, "PAP-5050: key_in_buffer:  pointer to the key(%p) is NULL or illegal path length(%d)",
-		   p_s_key, p_s_chk_path->path_length);
-  
-  if ( PATH_PLAST_BUFFER(p_s_chk_path)->b_dev == NODEV )
-    reiserfs_panic(p_s_sb, "PAP-5060: key_in_buffer: device must not be NODEV");
-#endif
+  RFALSE( ! p_s_key || p_s_chk_path->path_length < FIRST_PATH_ELEMENT_OFFSET ||
+	  p_s_chk_path->path_length > MAX_HEIGHT,
+	  "PAP-5050: pointer to the key(%p) is NULL or illegal path length(%d)",
+	  p_s_key, p_s_chk_path->path_length);
+  RFALSE( PATH_PLAST_BUFFER(p_s_chk_path)->b_dev == NODEV,
+	  "PAP-5060: device must not be NODEV");
 
   if ( COMP_KEYS(get_lkey(p_s_chk_path, p_s_sb), p_s_key) == 1 )
     /* left delimiting key is bigger, that the key we look for */
@@ -441,11 +425,9 @@ void decrement_counters_in_path (
             ) {
   int n_path_offset = p_s_search_path->path_length;
 
-#ifdef CONFIG_REISERFS_CHECK
-  if ( n_path_offset < ILLEGAL_PATH_ELEMENT_OFFSET ||
-       n_path_offset > EXTENDED_MAX_HEIGHT - 1 )
-    reiserfs_panic(NULL, "PAP-5080: decrement_counters_in_path: illegal path offset of %d", n_path_offset);
-#endif
+  RFALSE( n_path_offset < ILLEGAL_PATH_ELEMENT_OFFSET ||
+	  n_path_offset > EXTENDED_MAX_HEIGHT - 1,
+	  "PAP-5080: illegal path offset of %d", n_path_offset);
 
   while ( n_path_offset > ILLEGAL_PATH_ELEMENT_OFFSET ) {
     struct buffer_head * bh;
@@ -458,12 +440,8 @@ void decrement_counters_in_path (
 
 
 int reiserfs_check_path(struct path *p) {
-#ifdef CONFIG_REISERFS_CHECK 
-  if (p->path_length != ILLEGAL_PATH_ELEMENT_OFFSET) {
-    reiserfs_warning("check_path, path not properly relsed\n") ;
-    BUG() ;
-  }
-#endif
+  RFALSE( p->path_length != ILLEGAL_PATH_ELEMENT_OFFSET,
+	  "path not properly relsed") ;
   return 0 ;
 }
 
@@ -479,10 +457,8 @@ void  pathrelse_and_restore (
       ) {
   int n_path_offset = p_s_search_path->path_length;
 
-#ifdef CONFIG_REISERFS_CHECK
-  if ( n_path_offset < ILLEGAL_PATH_ELEMENT_OFFSET )
-    reiserfs_panic(NULL, "clm-4000: pathrelse: illegal path offset");
-#endif
+  RFALSE( n_path_offset < ILLEGAL_PATH_ELEMENT_OFFSET, 
+	  "clm-4000: illegal path offset");
   
   while ( n_path_offset > ILLEGAL_PATH_ELEMENT_OFFSET )  {
     reiserfs_restore_prepared_buffer(s, PATH_OFFSET_PBUFFER(p_s_search_path, 
@@ -498,10 +474,8 @@ void  pathrelse (
       ) {
   int n_path_offset = p_s_search_path->path_length;
 
-#ifdef CONFIG_REISERFS_CHECK
-  if ( n_path_offset < ILLEGAL_PATH_ELEMENT_OFFSET )
-    reiserfs_panic(NULL, "PAP-5090: pathrelse: illegal path offset");
-#endif
+  RFALSE( n_path_offset < ILLEGAL_PATH_ELEMENT_OFFSET,
+	  "PAP-5090: illegal path offset");
   
   while ( n_path_offset > ILLEGAL_PATH_ELEMENT_OFFSET )  
     brelse(PATH_OFFSET_PBUFFER(p_s_search_path, n_path_offset--));
@@ -742,15 +716,13 @@ int search_by_key (struct super_block * 
 	    continue;
 	}
 
+	RFALSE( ! key_in_buffer(p_s_search_path, p_s_key, p_s_sb),
+		"PAP-5130: key is not in the buffer");
 #ifdef CONFIG_REISERFS_CHECK
-
-	if ( ! key_in_buffer(p_s_search_path, p_s_key, p_s_sb) )
-	    reiserfs_panic(p_s_sb, "PAP-5130: search_by_key: key is not in the buffer");
 	if ( cur_tb ) {
 	    print_cur_tb ("5140");
 	    reiserfs_panic(p_s_sb, "PAP-5140: search_by_key: schedule occurred in do_balance!");
 	}
-
 #endif
 
 	// make sure, that the node contents look like a node of
@@ -765,13 +737,9 @@ int search_by_key (struct super_block * 
 	/* ok, we have acquired next formatted node in the tree */
 	n_node_level = B_LEVEL (p_s_bh);
 
-#ifdef CONFIG_REISERFS_CHECK
-
-	if (n_node_level < n_stop_level)
-	    reiserfs_panic (p_s_sb, "vs-5152: search_by_key: tree level is less than stop level (%d)",
-			    n_node_level, n_stop_level);
-
-#endif
+	RFALSE( n_node_level < n_stop_level,
+		"vs-5152: tree level is less than stop level (%d)",
+		n_node_level, n_stop_level);
 
 	n_retval = bin_search (p_s_key, B_N_PITEM_HEAD(p_s_bh, 0), B_NR_ITEMS(p_s_bh),
 			       ( n_node_level == DISK_LEAF_NODE_LEVEL ) ? IH_SIZE : KEY_SIZE, &(p_s_last_element->pe_position));
@@ -840,20 +808,17 @@ int search_for_position_by_key (struct s
 	return retval;
     if ( retval == ITEM_FOUND )  {
 
-#ifdef CONFIG_REISERFS_CHECK
-	if ( ! B_N_PITEM_HEAD(PATH_PLAST_BUFFER(p_s_search_path),
-			      PATH_LAST_POSITION(p_s_search_path))->ih_item_len )
-	    reiserfs_panic(p_s_sb, "PAP-5165: search_for_position_by_key: item length equals zero");
-#endif
+	RFALSE( ! B_N_PITEM_HEAD
+		(PATH_PLAST_BUFFER(p_s_search_path),
+		 PATH_LAST_POSITION(p_s_search_path))->ih_item_len,
+		"PAP-5165: item length equals zero");
 
 	pos_in_item(p_s_search_path) = 0;
 	return POSITION_FOUND;
     }
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( ! PATH_LAST_POSITION(p_s_search_path) )
-	reiserfs_panic(p_s_sb, "PAP-5170: search_for_position_by_key: position equals zero");
-#endif
+    RFALSE( ! PATH_LAST_POSITION(p_s_search_path), 
+	    "PAP-5170: position equals zero");
 
     /* Item is not found. Set path to the previous item. */
     p_le_ih = B_N_PITEM_HEAD(PATH_PLAST_BUFFER(p_s_search_path), --PATH_LAST_POSITION(p_s_search_path));
@@ -863,22 +828,6 @@ int search_for_position_by_key (struct s
 	return FILE_NOT_FOUND;
     }
 
-#if 0
-/*#ifdef CONFIG_REISERFS_CHECK*/
-
-  /* we expect to find stat data or item of the same type */
-    if ( ! is_statdata_le_ih(p_le_ih) && ((is_indirect_cpu_key(p_cpu_key) && ! is_indirect_le_ih(p_le_ih)) ||
-					  (is_direct_cpu_key(p_cpu_key) && ! is_direct_le_ih(p_le_ih))) ) {
-	print_block (PATH_PLAST_BUFFER(p_s_search_path), PRINT_LEAF_ITEMS, 
-		     PATH_LAST_POSITION (p_s_search_path) - 2,
-		     PATH_LAST_POSITION (p_s_search_path) + 2);
-	reiserfs_panic(p_s_sb, "PAP-5190: search_for_position_by_key: "
-		       "found item %h type does not match to the expected one %k",
-		       p_le_ih, p_cpu_key);
-    }
-/*#endif*/
-#endif
-
     // FIXME: quite ugly this far
 
     item_offset = le_ih_k_offset (p_le_ih);
@@ -1006,11 +955,8 @@ static inline int prepare_for_direntry_i
 {
     if (le_ih_k_offset (le_ih) == DOT_OFFSET && 
 	new_file_length == max_reiserfs_offset (inode)) {
-#ifdef CONFIG_REISERFS_CHECK
-	if (ih_entry_count (le_ih) != 2)
-	    reiserfs_panic(inode->i_sb,"PAP-5220: prepare_for_delete_or_cut: "
-			   "incorrect empty directory item (%h)", le_ih);
-#endif
+	RFALSE( ih_entry_count (le_ih) != 2,
+		"PAP-5220: incorrect empty directory item (%h)", le_ih);
 	*cut_size = -(IH_SIZE + le16_to_cpu (le_ih->ih_item_len));
 	return M_DELETE; /* Delete the directory item containing "." and ".." entry. */
     }
@@ -1054,10 +1000,8 @@ static char  prepare_for_delete_or_cut(
     /* Stat_data item. */
     if ( is_statdata_le_ih (p_le_ih) ) {
 
-#ifdef CONFIG_REISERFS_CHECK
-	if ( n_new_file_length != max_reiserfs_offset (inode) )
-	    reiserfs_panic(p_s_sb, "PAP-5210: prepare_for_delete_or_cut: mode must be M_DELETE");
-#endif
+	RFALSE( n_new_file_length != max_reiserfs_offset (inode),
+		"PAP-5210: mode must be M_DELETE");
 
 	*p_n_cut_size = -(IH_SIZE + le16_to_cpu (p_le_ih->ih_item_len));
 	return M_DELETE;
@@ -1098,13 +1042,11 @@ static char  prepare_for_delete_or_cut(
 	    /* Calculate number of unformatted nodes in this item. */
 	    n_unfm_number = I_UNFM_NUM(&s_ih);
 
-#ifdef CONFIG_REISERFS_CHECK
-	    if ( ! is_indirect_le_ih(&s_ih) || ! n_unfm_number ||
-		 pos_in_item (p_s_path) + 1 !=  n_unfm_number ) {
-		printk("n_unfm_number = %d *p_n_pos_in_item = %d\n",n_unfm_number, pos_in_item (p_s_path));
-		reiserfs_panic(p_s_sb, "PAP-5240: prepare_for_delete_or_cut: illegal item %h", &s_ih);
-	    }
-#endif
+	    RFALSE( ! is_indirect_le_ih(&s_ih) || ! n_unfm_number ||
+		    pos_in_item (p_s_path) + 1 !=  n_unfm_number,
+		    "PAP-5240: illegal item %h "
+		    "n_unfm_number = %d *p_n_pos_in_item = %d", 
+		    &s_ih, n_unfm_number, pos_in_item (p_s_path));
 
 	    /* Calculate balance mode and position in the item to remove unformatted nodes. */
 	    if ( n_new_file_length == max_reiserfs_offset (inode) ) {/* Case of delete. */
@@ -1122,10 +1064,8 @@ static char  prepare_for_delete_or_cut(
 		    /* indirect item must be truncated starting from *p_n_pos_in_item-th position */
 		    pos_in_item (p_s_path) = (n_new_file_length + n_blk_size - le_ih_k_offset (&s_ih) ) >> p_s_sb->s_blocksize_bits;
 
-#ifdef CONFIG_REISERFS_CHECK
-		    if ( pos_in_item (p_s_path) > n_unfm_number ) 
-			reiserfs_panic(p_s_sb, "PAP-5250: prepare_for_delete_or_cut: illegal position in the item");
-#endif
+		    RFALSE( pos_in_item (p_s_path) > n_unfm_number,
+			    "PAP-5250: illegal position in the item");
 
 		    /* Either convert last unformatted node of indirect item to direct item or increase
 		       its free space.  */
@@ -1140,10 +1080,8 @@ static char  prepare_for_delete_or_cut(
 		}
 	    }
 
-#ifdef CONFIG_REISERFS_CHECK
-	    if ( n_unfm_number <= pos_in_item (p_s_path) ) 
-		reiserfs_panic(p_s_sb, "PAP-5260: prepare_for_delete_or_cut: illegal position in the indirect item");
-#endif
+	    RFALSE( n_unfm_number <= pos_in_item (p_s_path),
+		    "PAP-5260: illegal position in the indirect item");
 
 	    /* pointers to be cut */
 	    n_unfm_number -= pos_in_item (p_s_path);
@@ -1169,11 +1107,9 @@ static char  prepare_for_delete_or_cut(
 		    need_research = 1 ;
 		    break;
 		}
-#ifdef CONFIG_REISERFS_CHECK
-		if (p_n_unfm_pointer < (__u32 *)B_I_PITEM(p_s_bh, &s_ih) ||
-		    p_n_unfm_pointer > (__u32 *)B_I_PITEM(p_s_bh, &s_ih) + I_UNFM_NUM(&s_ih) - 1)
-		    reiserfs_panic (p_s_sb, "vs-5265: prepare_for_delete_or_cut: pointer out of range");
-#endif
+		RFALSE( p_n_unfm_pointer < (__u32 *)B_I_PITEM(p_s_bh, &s_ih) ||
+			p_n_unfm_pointer > (__u32 *)B_I_PITEM(p_s_bh, &s_ih) + I_UNFM_NUM(&s_ih) - 1,
+			"vs-5265: pointer out of range");
 
 		if ( ! *p_n_unfm_pointer )  { /* Hole, nothing to remove. */
 		    if ( ! n_retry )
@@ -1221,13 +1157,12 @@ static char  prepare_for_delete_or_cut(
 		if ( ! n_retry )
 		    (*p_n_removed)++;
       
-#ifdef CONFIG_REISERFS_CHECK
-		if ( p_s_un_bh && (*p_n_unfm_pointer != p_s_un_bh->b_blocknr ))
+		RFALSE( p_s_un_bh && 
+			(*p_n_unfm_pointer != p_s_un_bh->b_blocknr ),
 		    // note: minix_truncate allows that. As truncate is
 		    // protected by down (inode->i_sem), two truncates can not
 		    // co-exist
-		    reiserfs_panic(p_s_sb, "PAP-5280: prepare_for_delete_or_cut: blocks numbers are different");	
-#endif
+			"PAP-5280: blocks numbers are different");	
 
 		tmp = *p_n_unfm_pointer;
 		*p_n_unfm_pointer = 0;
@@ -1251,9 +1186,8 @@ static char  prepare_for_delete_or_cut(
 	    if ( n_retry ) {
 		/* There is block in use. Wait, they should release it soon */
 
+		RFALSE( *p_n_removed >= n_unfm_number, "PAP-5290: illegal case");
 #ifdef CONFIG_REISERFS_CHECK
-		if ( *p_n_removed >= n_unfm_number )
-		    reiserfs_panic(p_s_sb, "PAP-5290: prepare_for_delete_or_cut: illegal case");
 		if ( !(++n_repeat_counter % 500000) ) {
 		    reiserfs_warning("PAP-5300: prepare_for_delete_or_cut: (pid %u): "
 				     "could not delete item %k in (%d) iterations. New file length %Lu. (inode %Ld), Still trying\n",
@@ -1275,15 +1209,10 @@ static char  prepare_for_delete_or_cut(
 	} while ( (*p_n_removed < n_unfm_number || need_research) &&
 		  search_for_position_by_key(p_s_sb, p_s_item_key, p_s_path) == POSITION_FOUND );
 
-#ifdef CONFIG_REISERFS_CHECK
-	if ( *p_n_removed < n_unfm_number )
-	    reiserfs_panic(p_s_sb, "PAP-5310: prepare_for_delete_or_cut: indirect item is not found");
-
-	if (item_moved (&s_ih, p_s_path) ) {
-	    printk("prepare_for_delete_or_cut: after while, comp failed, retry\n") ;
-	    BUG ();
-	}
-#endif
+	RFALSE( *p_n_removed < n_unfm_number, 
+		"PAP-5310: indirect item is not found");
+	RFALSE( item_moved (&s_ih, p_s_path), 
+		"after while, comp failed, retry") ;
 
 	if (c_mode == M_CUT)
 	    pos_in_item (p_s_path) *= UNFM_P_SIZE;
@@ -1375,10 +1304,7 @@ int reiserfs_delete_item (struct reiserf
 #endif
 	    prepare_for_delete_or_cut(th, p_s_inode, p_s_path, p_s_item_key, &n_removed, &n_del_size, max_reiserfs_offset (p_s_inode));
 
-#ifdef CONFIG_REISERFS_CHECK
-	if ( c_mode != M_DELETE )
-	    reiserfs_panic(p_s_sb, "PAP-5320: reiserfs_delete_item: mode must be M_DELETE");
-#endif
+	RFALSE( c_mode != M_DELETE, "PAP-5320: mode must be M_DELETE");
 
 	copy_item_head(&s_ih, PATH_PITEM_HEAD(p_s_path));
 	s_del_balance.insert_size[0] = n_del_size;
@@ -1597,19 +1523,14 @@ static void indirect_to_direct_roll_back
 	/* look for the last byte of the tail */
 	if (search_for_position_by_key (inode->i_sb, &tail_key, path) == POSITION_NOT_FOUND)
 	    reiserfs_panic (inode->i_sb, "vs-5615: indirect_to_direct_roll_back: found invalid item");
-#ifdef CONFIG_REISERFS_CHECK
-	if (path->pos_in_item != PATH_PITEM_HEAD (path)->ih_item_len - 1)
-	    reiserfs_panic (inode->i_sb, "vs-5616: indirect_to_direct_roll_back: appended bytes found");
-#endif
+	RFALSE( path->pos_in_item != PATH_PITEM_HEAD (path)->ih_item_len - 1,
+		"vs-5616: appended bytes found");
 	PATH_LAST_POSITION (path) --;
 	
 	removed = reiserfs_delete_item (th, path, &tail_key, inode, 0/*unbh not needed*/);
-#ifdef CONFIG_REISERFS_CHECK
-	if (removed <= 0 || removed > tail_len)
-	    reiserfs_panic (inode->i_sb, "vs-5617: indirect_to_direct_roll_back: "
-			    "there was tail %d bytes, removed item length %d bytes",
-			    tail_len, removed);
-#endif
+	RFALSE( removed <= 0 || removed > tail_len,
+		"vs-5617: there was tail %d bytes, removed item length %d bytes",
+		tail_len, removed);
 	tail_len -= removed;
 	set_cpu_key_k_offset (&tail_key, cpu_key_k_offset (&tail_key) - removed);
     }
@@ -1657,10 +1578,7 @@ int reiserfs_cut_from_item (struct reise
 	if ( c_mode == M_CONVERT )  {
 	    /* convert last unformatted node to direct item or leave
                tail in the unformatted node */
-#ifdef CONFIG_REISERFS_CHECK
-	    if ( n_ret_value != CARRY_ON )
-		reiserfs_panic (p_s_sb, "PAP-5570: reiserfs_cut_from_item: can not convert twice");
-#endif
+	    RFALSE( n_ret_value != CARRY_ON, "PAP-5570: can not convert twice");
 
 	    n_ret_value = maybe_indirect_to_direct (th, p_s_inode, page, p_s_path, p_s_item_key,
 						    n_new_file_size, &c_mode);
@@ -1724,10 +1642,7 @@ int reiserfs_cut_from_item (struct reise
 
     /* go ahead and perform balancing */
     
-#ifdef CONFIG_REISERFS_CHECK
-    if ( c_mode == M_PASTE || c_mode == M_INSERT )
-	reiserfs_panic (p_s_sb, "PAP-5640: reiserfs_cut_from_item: illegal mode");
-#endif
+    RFALSE( c_mode == M_PASTE || c_mode == M_INSERT, "illegal mode");
 
     /* Calculate number of bytes that need to be cut from the item. */
     if (retval2 == -1)
@@ -1879,13 +1794,9 @@ void reiserfs_do_truncate (struct reiser
 	    return;
 	}
 
-#ifdef CONFIG_REISERFS_CHECK
-	if ( n_deleted > n_file_size ){
-	    reiserfs_panic (p_s_inode->i_sb, "PAP-5670: reiserfs_truncate_file: "
-			    "reiserfs_truncate_file returns too big number: deleted %d, file_size %lu, item_key %k",
-			    n_deleted, n_file_size, &s_item_key);
-	}
-#endif
+	RFALSE( n_deleted > n_file_size,
+		"PAP-5670: reiserfs_truncate_file returns too big number: deleted %d, file_size %lu, item_key %k",
+		n_deleted, n_file_size, &s_item_key);
 
 	/* Change key to search the last file item. */
 	n_file_size -= n_deleted;
@@ -1917,12 +1828,9 @@ void reiserfs_do_truncate (struct reiser
     } while ( n_file_size > ROUND_UP (n_new_file_size) &&
 	      search_for_position_by_key(p_s_inode->i_sb, &s_item_key, &s_search_path) == POSITION_FOUND )  ;
 
-#ifdef CONFIG_REISERFS_CHECK
-    if ( n_file_size > ROUND_UP (n_new_file_size) )
-	reiserfs_panic (p_s_inode->i_sb, "PAP-5680: reiserfs_truncate_file: "
-			"truncate did not finish: new_file_size %Ld, current %Ld, oid %d\n",
-			n_new_file_size, n_file_size, s_item_key.on_disk_key.k_objectid);
-#endif
+    RFALSE( n_file_size > ROUND_UP (n_new_file_size),
+	    "PAP-5680: truncate did not finish: new_file_size %Ld, current %Ld, oid %d\n",
+	    n_new_file_size, n_file_size, s_item_key.on_disk_key.k_objectid);
 
     if (update_timestamps) {
 	// this is truncate, not file closing
diff -rup linux-2.4.7-ac1/fs/reiserfs/tail_conversion.c linux-2.4.7-ac1.patched/fs/reiserfs/tail_conversion.c
--- linux-2.4.7-ac1/fs/reiserfs/tail_conversion.c	Fri Jul 27 22:16:50 2001
+++ linux-2.4.7-ac1.patched/fs/reiserfs/tail_conversion.c	Fri Jul 27 22:22:27 2001
@@ -92,12 +92,9 @@ int direct2indirect (struct reiserfs_tra
 	    reiserfs_panic (sb, "PAP-14050: direct2indirect: "
 			    "direct item (%k) not found", &end_key);
 	p_le_ih = PATH_PITEM_HEAD (path);
-#ifdef CONFIG_REISERFS_CHECK
-	if (!is_direct_le_ih (p_le_ih))
-	    reiserfs_panic (sb, "vs-14055: direct2indirect: "
-			    "direct item expected(%k), found %h", 
-				&end_key, p_le_ih);
-#endif
+	RFALSE( !is_direct_le_ih (p_le_ih),
+		"vs-14055: direct item expected(%k), found %h", 
+		&end_key, p_le_ih);
 	tail_size = (le_ih_k_offset (p_le_ih) & (n_blk_size - 1))
 	    + ih_item_len(p_le_ih) - 1;
 
diff -rup linux-2.4.7-ac1/include/linux/reiserfs_fs.h linux-2.4.7-ac1.patched/include/linux/reiserfs_fs.h
--- linux-2.4.7-ac1/include/linux/reiserfs_fs.h	Fri Jul 27 22:21:51 2001
+++ linux-2.4.7-ac1.patched/include/linux/reiserfs_fs.h	Fri Jul 27 22:22:27 2001
@@ -17,6 +17,7 @@
 #ifdef __KERNEL__
 #include <linux/slab.h>
 #include <linux/tqueue.h>
+#include <asm/hardirq.h>
 #endif
 
 /*
@@ -97,6 +98,21 @@
 ** messages.
 */
 #define REISERFS_DEBUG_CODE 5 /* extra messages to help find/debug errors */ 
+
+/* assertions handling */
+
+/** always check a condition and panic if it's false. */
+#define RASSERT( cond, format, args... )					\
+if( !( cond ) ) 								\
+  reiserfs_panic( 0, "reiserfs[%i]: assertion " #cond " failed at "		\
+		  __FILE__ ":%i:" __FUNCTION__ ": " format "\n",		\
+		  in_interrupt() ? -1 : current -> pid, __LINE__ , ##args )
+
+#if defined( CONFIG_REISERFS_CHECK )
+#define RFALSE( cond, format, args... ) RASSERT( !( cond ), format, ##args )
+#else
+#define RFALSE( cond, format, args... ) do {;} while( 0 )
+#endif
 
 /*
  * Disk Data Structures
