GIT: unionfs2-2.6.27.y: Unionfs: Provide more helpful info on branch leaks during unmount

Erez Zadok ezk at fsl.cs.sunysb.edu
Thu Aug 12 23:15:57 EDT 2010


commit 8fb5f40153729c1c4bab154367e98e5c2fdde8ee
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Mar 19 03:01:49 2007 -0400

    Unionfs: Provide more helpful info on branch leaks during unmount
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
    [jsipek: no need to take a read lock on the superblock private data]
    Signed-off-by: Josef 'Jeff' Sipek <jsipek at cs.sunysb.edu>

diff --git a/fs/unionfs/super.c b/fs/unionfs/super.c
index 571b589..037c47d 100644
--- a/fs/unionfs/super.c
+++ b/fs/unionfs/super.c
@@ -97,6 +97,7 @@ static void unionfs_put_super(struct super_block *sb)
 {
 	int bindex, bstart, bend;
 	struct unionfs_sb_info *spd;
+	int leaks = 0;
 
 	spd = UNIONFS_SB(sb);
 	if (!spd)
@@ -107,7 +108,12 @@ static void unionfs_put_super(struct super_block *sb)
 
 	/* Make sure we have no leaks of branchget/branchput. */
 	for (bindex = bstart; bindex <= bend; bindex++)
-		BUG_ON(branch_count(sb, bindex) != 0);
+		if (branch_count(sb, bindex) != 0) {
+			printk("unionfs: branch %d has %d references left!\n",
+			       bindex, branch_count(sb,bindex));
+			leaks = 1;
+		}
+	BUG_ON(leaks != 0);
 
 	kfree(spd->data);
 	kfree(spd);


More information about the unionfs-cvs mailing list