Unionfs: ensure we have lower dentries in d_iput
authorErez Zadok <ezk@cs.sunysb.edu>
Thu, 10 Jan 2008 00:15:55 +0000 (19:15 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 23 Mar 2008 03:49:23 +0000 (23:49 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/dentry.c

index 29ebf0b84fd7b29b9ac134249358231460461a9b..77fe63776f501b6fded60ffe3611d855ec7c95c1 100644 (file)
@@ -498,9 +498,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)) {