{
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 */
unionfs_unlock_dentry(dentry);
+
+ unionfs_read_unlock(dentry->d_sb);
out:
free_dentry_private_data(dentry);
- unionfs_read_unlock(dentry->d_sb);
return;
}