From: NeilBrown Date: Fri, 25 Jun 2010 06:21:06 +0000 (+1000) Subject: Relax loop count restriction in truncation. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=fa2b7bea2d3e774fa63aee529b9b54a54e36a610;p=LaFS.git Relax loop count restriction in truncation. It is possible to hit the current count in normal operations, so make it a lot gentler. Signed-off-by: NeilBrown --- diff --git a/inode.c b/inode.c index 027f856..6c0f062 100644 --- a/inode.c +++ b/inode.c @@ -581,6 +581,7 @@ void lafs_inode_handle_orphan(struct datablock *b) struct fs *fs = fs_from_inode(ino); u32 trunc_next, next_trunc; int do_restart; + int loop_cnt = 20; restart: do_restart = 1; @@ -695,10 +696,9 @@ void lafs_inode_handle_orphan(struct datablock *b) lafs_iounlock_block(&ib2->b); if (!list_empty(&ib2->b.siblings)) { - static int cnt = 10; printk("looping on %s\n", strblk(&ib2->b)); - cnt--; - if (cnt < 0) + loop_cnt--; + if (loop_cnt < 0) BUG(); } putiref(ib2, MKREF(inode_handle_orphan2));