bug fix: don't warn if trying to mntput a "negative" union object
authorErez_Zadok <ezk@cs.sunysb.edu>
Mon, 28 May 2007 23:21:21 +0000 (19:21 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 11 Nov 2014 02:33:21 +0000 (21:33 -0500)
In unionfs_d_release, we may get negative dentries which don't have a lower
mnt.  In that case, don't print a warning message from unionfs_mntput about
trying to put a NULL mnt.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/dentry.c

index 1653267c1d5a5fa94861e633237f1954bcfecae8..c9ff88676db211d7daaf2819349400a67b020a20 100644 (file)
@@ -325,9 +325,11 @@ static void unionfs_d_release(struct dentry *dentry)
        bend = dbend(dentry);
        for (bindex = bstart; bindex <= bend; bindex++) {
                dput(unionfs_lower_dentry_idx(dentry, bindex));
-               unionfs_mntput(dentry, bindex);
-
                unionfs_set_lower_dentry_idx(dentry, bindex, NULL);
+               /* NULL lower mnt is ok if this is a negative dentry */
+               if (!dentry->d_inode && !unionfs_lower_mnt_idx(dentry,bindex))
+                       continue;
+               unionfs_mntput(dentry, bindex);
                unionfs_set_lower_mnt_idx(dentry, bindex, NULL);
        }
        /* free private data (unionfs_dentry_info) here */