From: Erez Zadok Date: Sat, 30 Apr 2011 05:33:57 +0000 (-0400) Subject: Unionfs: revalidate files which are open but unlinked X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=b8bbd72178df2c70e4f455746679e6bb072a5de0;p=unionfs-2.6.39.y.git Unionfs: revalidate files which are open but unlinked Need to re-open the file if the starting dentry is on a higher priority branch than the currently opened file (which could happen when we ftruncate an opened, but unlinked file). Signed-off-by: Erez Zadok --- diff --git a/fs/unionfs/commonfops.c b/fs/unionfs/commonfops.c index 51ea65e82b4..77ddfe4632c 100644 --- a/fs/unionfs/commonfops.c +++ b/fs/unionfs/commonfops.c @@ -312,7 +312,7 @@ static int __unionfs_file_revalidate(struct file *file, struct dentry *dentry, * someone has copied up this file from underneath us, we also need * to refresh things. */ - if (d_deleted(dentry) || + if ((d_deleted(dentry) && dbstart(dentry) >= fbstart(file)) || (sbgen <= fgen && dbstart(dentry) == fbstart(file) && unionfs_lower_file(file)))