Unionfs: don't bother validating dentry if it has no lower branches
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 27 Nov 2007 00:54:14 +0000 (19:54 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 27 Nov 2007 00:54:14 +0000 (19:54 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/debug.c

index f3896fe11b566965da304723e61d4a7f091f4e10..62bc41d2699d7eb8955e04e7cab3cec8a54d144d 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;