[PATCH 5/9] Unionfs: don't bother validating dentry if it has no lower branches

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <akpm@...>
Cc: <linux-kernel@...>, <linux-fsdevel@...>, <viro@...>, <hch@...>, Erez Zadok <ezk@...>
Date: Sunday, October 21, 2007 - 7:51 pm

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
---
 fs/unionfs/debug.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/unionfs/debug.c b/fs/unionfs/debug.c
index 68692d7..894bf7c 100644
--- a/fs/unionfs/debug.c
+++ b/fs/unionfs/debug.c
@@ -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;
-- 
1.5.2.2

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PULL -mm] 0/9 Unionfs updates/cleanups/fixes, Erez Zadok, (Sun Oct 21, 7:51 pm)
Re: [PATCH 1/9] Unionfs: security convert lsm into a static ..., Christoph Hellwig, (Mon Oct 22, 4:22 am)
Re: [PATCH 1/9] Unionfs: security convert lsm into a static ..., Christoph Hellwig, (Tue Oct 23, 5:07 am)
[PATCH 5/9] Unionfs: don't bother validating dentry if it ha..., Erez Zadok, (Sun Oct 21, 7:51 pm)