GIT: unionfs2-2.6.27.y: mmap: also revalidate file passed to unionfs_release

Erez Zadok ezk at fsl.cs.sunysb.edu
Thu Aug 12 23:16:22 EDT 2010


commit 102189193e604a6fabf6d84ba19075441b51ef32
Author: Erez_Zadok <ezk at cs.sunysb.edu>
Date:   Sat May 19 19:17:30 2007 -0400

    mmap: also revalidate file passed to unionfs_release
    
    Conflicts:
    
    	fs/unionfs/commonfops.c

diff --git a/fs/unionfs/commonfops.c b/fs/unionfs/commonfops.c
index fd2e546..b0ec71b 100644
--- a/fs/unionfs/commonfops.c
+++ b/fs/unionfs/commonfops.c
@@ -603,12 +603,19 @@ out_nofree:
 int unionfs_file_release(struct inode *inode, struct file *file)
 {
 	struct file *hidden_file = NULL;
-	struct unionfs_file_info *fileinfo = UNIONFS_F(file);
-	struct unionfs_inode_info *inodeinfo = UNIONFS_I(inode);
+	struct unionfs_file_info *fileinfo;
+	struct unionfs_inode_info *inodeinfo;
 	struct super_block *sb = inode->i_sb;
 	int bindex, bstart, bend;
 	int fgen, err = 0;
 
+	unionfs_read_lock(sb);
+	if ((err = unionfs_file_revalidate(file, 1)))
+		goto out;
+	fileinfo = UNIONFS_F(file);
+	BUG_ON(file->f_dentry->d_inode != inode);
+	inodeinfo = UNIONFS_I(inode);
+
 	unionfs_check_file(file);
 	unionfs_read_lock(sb);
 	/*
@@ -618,6 +625,7 @@ int unionfs_file_release(struct inode *inode, struct file *file)
 	 */
 	if ((err = unionfs_file_revalidate(file, 1)))
 		goto out;
+
 	/* fput all the hidden files */
 	fgen = atomic_read(&fileinfo->generation);
 	bstart = fbstart(file);


More information about the unionfs-cvs mailing list