GIT: unionfs2-2.6.27.y: Unionfs: set append offset correctly for copied-up files

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


commit 6441b4d9ef60aa627e531dbf638e6ed4847e90ed
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Thu Apr 10 15:32:26 2008 -0400

    Unionfs: set append offset correctly for copied-up files
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

diff --git a/fs/unionfs/commonfops.c b/fs/unionfs/commonfops.c
index 0fc7963..83034c2 100644
--- a/fs/unionfs/commonfops.c
+++ b/fs/unionfs/commonfops.c
@@ -258,9 +258,13 @@ static int do_delayed_copyup(struct file *file)
 		else
 			err = copyup_deleted_file(file, dentry, bstart,
 						  bindex);
-
-		if (!err)
+		/* if succeeded, set lower open-file flags and break */
+		if (!err) {
+			struct file *lower_file;
+			lower_file = unionfs_lower_file_idx(file, bindex);
+			lower_file->f_flags = file->f_flags;
 			break;
+		}
 	}
 	if (err || (bstart <= fbstart(file)))
 		goto out;
@@ -491,6 +495,10 @@ static int __open_file(struct inode *inode, struct file *file)
 			}
 			return err;
 		} else {
+			/*
+			 * turn off writeable flags, to force delayed copyup
+			 * by caller.
+			 */
 			lower_flags &= ~(OPEN_WRITE_FLAGS);
 		}
 	}


More information about the unionfs-cvs mailing list