Unionfs: unionfs_permission locking fixes
authorErez Zadok <ezk@cs.sunysb.edu>
Fri, 19 Sep 2008 02:22:26 +0000 (22:22 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Mon, 12 Jan 2009 23:20:58 +0000 (18:20 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/inode.c

index a174e5577d77aeee5f4359f3d9779e4216907969..bc357c0aa6de9071a3ce329375f92a5971508812 100644 (file)
@@ -789,6 +789,7 @@ static int unionfs_permission(struct inode *inode, int mask,
        int bindex, bstart, bend;
        const int is_file = !S_ISDIR(inode->i_mode);
        const int write_mask = (mask & MAY_WRITE) && !(mask & MAY_READ);
+       struct inode *inode_grabbed = igrab(inode);
 
        if (nd)
                unionfs_lock_dentry(nd->path.dentry, UNIONFS_DMUTEX_CHILD);
@@ -869,6 +870,7 @@ out:
        unionfs_check_nd(nd);
        if (nd)
                unionfs_unlock_dentry(nd->path.dentry);
+       iput(inode_grabbed);
        return err;
 }