]> git.neil.brown.name Git - LaFS.git/commitdiff
truncate: make sure index changes get incorporated.
authorNeilBrown <neilb@suse.de>
Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)
When we have used lafs_incorporate to clear and unpin
an index block we need to incorporate the parent so that
the unpinned block gets fully released.

inode.c

diff --git a/inode.c b/inode.c
index a544859e8e3c51e2b6ffccc363af5ffcaa053e67..c09db2950a99127e8000aa3b33a76532c48fd197 100644 (file)
--- a/inode.c
+++ b/inode.c
@@ -700,6 +700,12 @@ static int lafs_inode_handle_orphan(struct datablock *b)
                        if (cnt < 0)
                                BUG();
                }
+               if (ib->uninc) {
+                       lafs_iolock_written(&ib->b);
+                       while (ib->uninc)
+                               lafs_incorporate(fs, ib);
+                       lafs_iounlock_block(&ib->b);
+               }
                putiref(ib, MKREF(inode_handle_orphan));
                return 1; /* Try again whenever */
        }