Unionfs: don't bother validating dentry if it has no lower branches
authorErez Zadok <ezk@cs.sunysb.edu>
Wed, 17 Oct 2007 21:35:02 +0000 (17:35 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Wed, 17 Oct 2007 21:35:02 +0000 (17:35 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/debug.c

index 9117394a846fb868430610e8037c5c023060b5e1..2e0525f41c008fb5152fdb956a4b6986daf99bfc 100644 (file)
@@ -132,6 +132,9 @@ void __unionfs_check_dentry(const struct dentry *dentry,
        inode = dentry->d_inode;
        dstart = dbstart(dentry);
        dend = dbend(dentry);
+       /* don't check dentry/mnt if no lower branches */
+       if (dstart < 0 && dend < 0)
+               goto check_inode;
        BUG_ON(dstart > dend);
 
        if (unlikely((dstart == -1 && dend != -1) ||
@@ -212,6 +215,7 @@ void __unionfs_check_dentry(const struct dentry *dentry,
                }
        }
 
+check_inode:
        /* for inodes now */
        if (!inode)
                return;