From: Erez Zadok Date: Thu, 10 Apr 2008 19:32:26 +0000 (-0400) Subject: Unionfs: set append offset correctly for copied-up files X-Git-Tag: unionfs-2.3.3~6 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=0be4a2a3bfa504e0590226c44b7e01af0814502b;p=unionfs-2.6.31.y.git Unionfs: set append offset correctly for copied-up files Signed-off-by: Erez Zadok --- diff --git a/fs/unionfs/commonfops.c b/fs/unionfs/commonfops.c index 0fc79633af1..83034c2d1f9 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); } }