From b8bbd72178df2c70e4f455746679e6bb072a5de0 Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Sat, 30 Apr 2011 01:33:57 -0400 Subject: [PATCH] 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 --- fs/unionfs/commonfops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))) -- 2.34.1