]> git.neil.brown.name Git - LaFS.git/commitdiff
Relax loop count restriction in truncation.
authorNeilBrown <neilb@suse.de>
Fri, 25 Jun 2010 06:21:06 +0000 (16:21 +1000)
committerNeilBrown <neilb@suse.de>
Fri, 25 Jun 2010 06:21:06 +0000 (16:21 +1000)
It is possible to hit the current count in normal operations,
so make it a lot gentler.

Signed-off-by: NeilBrown <neilb@suse.de>
inode.c

diff --git a/inode.c b/inode.c
index 027f856750f43b3c88464f23990fb35a303406dd..6c0f062d286d22726a1a3e53ab8d4957b2755fa5 100644 (file)
--- 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));