Unionfs: ensure we have lower dentries in d_iput
authorErez Zadok <ezk@cs.sunysb.edu>
Thu, 10 Jan 2008 17:14:40 +0000 (12:14 -0500)
committerRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Thu, 1 May 2008 23:03:34 +0000 (19:03 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/dentry.c

index 3fce8427f705002e19003d8ee43bfcbf3747fa8e..548bfca6ccda04d8027c1e3f9ed1425e369adf13 100644 (file)
@@ -525,9 +525,10 @@ static void unionfs_d_iput(struct dentry *dentry, struct inode *inode)
 {
        int bindex, rc;
 
+       BUG_ON(!dentry);
        unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
 
-       if (dbstart(dentry) < 0)
+       if (!UNIONFS_D(dentry) || dbstart(dentry) < 0)
                goto drop_lower_inodes;
        for (bindex = dbstart(dentry); bindex <= dbend(dentry); bindex++) {
                if (unionfs_lower_mnt_idx(dentry, bindex)) {