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>
Fri, 12 Aug 2011 02:36:37 +0000 (22:36 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/debug.c

index 68692d7858053f5acfdf0b79bf067f7e8ab56030..894bf7cecc03a14374f52862e693aac9884b4d22 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;