Unionfs: vfsmount reference counting fixes
authorErez Zadok <ezk@cs.sunysb.edu>
Fri, 23 Mar 2007 00:08:30 +0000 (20:08 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Mon, 12 Jan 2009 23:20:21 +0000 (18:20 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
fs/unionfs/dentry.c

index 4756b782cb02e24a59ba3b99bb5d58423741d13d..b08842fab1710d691d4c7609ae9539250f0b480c 100644 (file)
@@ -235,8 +235,8 @@ int __unionfs_d_revalidate_chain(struct dentry *dentry, struct nameidata *nd)
                valid = __unionfs_d_revalidate_one(chain[i], nd);
                /* XXX: is this the correct mntput condition?! */
                if (valid && chain_len > 0 &&
-                   sbgen != dgen && dentry->d_inode &&
-                   S_ISDIR(dentry->d_inode->i_mode)) {
+                   sbgen != dgen && chain[i]->d_inode &&
+                   S_ISDIR(chain[i]->d_inode->i_mode)) {
                        for (bindex = saved_bstart; bindex <= saved_bend; bindex++)
                                unionfs_mntput(chain[i], bindex);
                }
@@ -256,9 +256,7 @@ int __unionfs_d_revalidate_chain(struct dentry *dentry, struct nameidata *nd)
        saved_bend = dbend(dentry);
        valid = __unionfs_d_revalidate_one(dentry, nd);
 
-       if (valid && chain_len > 0 &&
-           sbgen != dgen && dentry->d_inode &&
-           S_ISDIR(dentry->d_inode->i_mode)) {
+       if (valid && chain_len > 0 && sbgen != dgen) {
                for (bindex = saved_bstart; bindex <= saved_bend; bindex++)
                        unionfs_mntput(dentry, bindex);
        }