From: Erez Zadok Date: Tue, 16 Aug 2011 23:40:12 +0000 (-0400) Subject: Unionfs: fix oops bug in file_revalidate X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=cab144624b5ae6478c5e44151579df4a478c7cca;p=unionfs-2.6.39.y.git Unionfs: fix oops bug in file_revalidate Reverses commit "3e9b8b599aa6832e464f86872ca37840090de630" (in unionfs-3.1 tree) which did this: ``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).'' That fix caused oopses in file_revalidate for some people. So, I'm reversing that old fix: it's possible that bug is already fixed thanks to other code changes. If not, we'll need to test and fix revalidation of open/unlinked files differently and carefully. Signed-off-by: Erez Zadok --- diff --git a/fs/unionfs/commonfops.c b/fs/unionfs/commonfops.c index 0a271f44da2..cd5c3048a39 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) && dbstart(dentry) >= fbstart(file)) || + if (d_deleted(dentry) || (sbgen <= fgen && dbstart(dentry) == fbstart(file) && unionfs_lower_file(file)))