commit 2ceed14fabbfddac8fabd0a7baa0d90912088ba5
Author: Rachita Kothiyal <[EMAIL PROTECTED]>
Date: Sun May 18 03:28:34 2008 -0400
Unionfs ODF: Check UNIONFS_D before grabbing dentry lock
First check if the UNIONFS_D() is non NULL, and only then grab
a lock on the dentry. Since trying to grab a lock, which is a
member of UNIONFS_D(), doesn't make sense if it is itself NULL
Signed-off-by: Rachita Kothiyal <[EMAIL PROTECTED]>
diff --git a/fs/unionfs/dentry.c b/fs/unionfs/dentry.c
index 3faae79..d034708 100644
--- a/fs/unionfs/dentry.c
+++ b/fs/unionfs/dentry.c
@@ -499,16 +499,14 @@ static void unionfs_d_release(struct dentry *dentry)
{
int bindex, bstart, bend;
+ /* this could be a negative dentry, so check first */
+ if (unlikely(!UNIONFS_D(dentry) || dbstart(dentry) < 0))
+ goto out; /* due to a (normal) failed lookup */
+
unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
/* must lock our branch configuration here */
unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
- /* this could be a negative dentry, so check first */
- if (unlikely(!UNIONFS_D(dentry) || dbstart(dentry) < 0)) {
- unionfs_unlock_dentry(dentry);
- goto out; /* due to a (normal) failed lookup */
- }
-
unionfs_check_dentry(dentry);
/* Release all the lower dentries */
@@ -529,9 +527,10 @@ static void unionfs_d_release(struct dentry *dentry)
unionfs_unlock_dentry(dentry);
+
+ unionfs_read_unlock(dentry->d_sb);
out:
free_dentry_private_data(dentry);
- unionfs_read_unlock(dentry->d_sb);
return;
}
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs