GIT: unionfs2-2.6.27.y: Unionfs: copy lower times in fsync/fasync only when needed

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


commit a3021b1f0ca5d4a3b574de7178ab97d11d8490de
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Thu Apr 3 13:15:59 2008 -0400

    Unionfs: copy lower times in fsync/fasync only when needed
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

diff --git a/fs/unionfs/file.c b/fs/unionfs/file.c
index 1fe4c30..f14b38b 100644
--- a/fs/unionfs/file.c
+++ b/fs/unionfs/file.c
@@ -196,13 +196,13 @@ int unionfs_fsync(struct file *file, struct dentry *dentry, int datasync)
 		err = lower_inode->i_fop->fsync(lower_file,
 						lower_dentry,
 						datasync);
+		if (!err && bindex == bstart)
+			fsstack_copy_attr_times(inode, lower_inode);
 		mutex_unlock(&lower_inode->i_mutex);
 		if (err)
 			goto out;
 	}
 
-	unionfs_copy_attr_times(inode);
-
 out:
 	if (!err)
 		unionfs_check_file(file);
@@ -244,13 +244,13 @@ int unionfs_fasync(int fd, struct file *file, int flag)
 		lower_file = unionfs_lower_file_idx(file, bindex);
 		mutex_lock(&lower_inode->i_mutex);
 		err = lower_inode->i_fop->fasync(fd, lower_file, flag);
+		if (!err && bindex == bstart)
+			fsstack_copy_attr_times(inode, lower_inode);
 		mutex_unlock(&lower_inode->i_mutex);
 		if (err)
 			goto out;
 	}
 
-	unionfs_copy_attr_times(inode);
-
 out:
 	if (!err)
 		unionfs_check_file(file);


More information about the unionfs-cvs mailing list