Unionfs: don't bother validating inode if it has no lower branches
authorErez Zadok <ezk@cs.sunysb.edu>
Thu, 1 Nov 2007 04:41:03 +0000 (00:41 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 29 Apr 2011 02:25:12 +0000 (22:25 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/debug.c

index 894bf7cecc03a14374f52862e693aac9884b4d22..0066ccd9ec7496943ae70aa60da5b03810b6e971 100644 (file)
@@ -49,6 +49,9 @@ void __unionfs_check_inode(const struct inode *inode,
        sb = inode->i_sb;
        istart = ibstart(inode);
        iend = ibend(inode);
+       /* don't check inode if no lower branches */
+       if (istart < 0 && iend < 0)
+               return;
        if (unlikely(istart > iend)) {
                PRINT_CALLER(fname, fxn, line);
                pr_debug(" Ci0: inode=%p istart/end=%d:%d\n",
@@ -221,6 +224,9 @@ check_inode:
                return;
        istart = ibstart(inode);
        iend = ibend(inode);
+       /* don't check inode if no lower branches */
+       if (istart < 0 && iend < 0)
+               return;
        BUG_ON(istart > iend);
        if (unlikely((istart == -1 && iend != -1) ||
                     (istart != -1 && iend == -1))) {