
From: Hans Reiser <reiser@namesys.com>

Reiser4 tree traverse may restart.  The code is written such that before
restarting it is not clear why did previous tree traverse fail: it may be
either give up to avoid deadlock and (less likely) tree corruption.  In the
first case we want to repeat substantial number of times.  So, it was set
to 0xffffffff.  It was a bug because repeat++ > 0xffffffff will be never
true and tree traverse will loop forever in case of tree corruption.  This
patch fixes this bug.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/reiser4/reiser4.h |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/reiser4/reiser4.h~reiser4-max_cbk_iteration-fix fs/reiser4/reiser4.h
--- 25/fs/reiser4/reiser4.h~reiser4-max_cbk_iteration-fix	Fri Nov 12 16:01:55 2004
+++ 25-akpm/fs/reiser4/reiser4.h	Fri Nov 12 16:01:55 2004
@@ -396,7 +396,7 @@ extern const int REISER4_MAGIC_OFFSET;	/
    I have witnessed more than 800 iterations (in 30 thread test) before cbk
    finished. --nikita
 */
-#define REISER4_MAX_CBK_ITERATIONS    ((unsigned)~0)
+#define REISER4_MAX_CBK_ITERATIONS    500000
 
 /* put a per-inode limit on maximal number of directory entries with identical
    keys in hashed directory.
_
