GIT: unionfs2-2.6.27.y: Unionfs: branch-management bugfix to unionfs_file_revalidate

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


commit 33dc029b7fee9eb4763130a62a1f3394d0e478c1
Author: Erez_Zadok <ezk at cs.sunysb.edu>
Date:   Sat Jul 21 02:38:14 2007 -0400

    Unionfs: branch-management bugfix to unionfs_file_revalidate
    
    If we re-opened the file on a different branch than the original one, and
    only if this was due to a new branch inserted, then update the mnt counts of
    the old and new branches accordingly.
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

diff --git a/fs/unionfs/commonfops.c b/fs/unionfs/commonfops.c
index f6f7dea..baa6a37 100644
--- a/fs/unionfs/commonfops.c
+++ b/fs/unionfs/commonfops.c
@@ -370,11 +370,12 @@ int unionfs_file_revalidate(struct file *file, int willwrite)
 				goto out;
 			new_brid = UNIONFS_F(file)->
 			  saved_branch_ids[fbstart(file)];
-			if (new_brid != orig_brid) {
+			if (new_brid != orig_brid && sbgen > fgen) {
 				/*
 				 * If we re-opened the file on a different
-				 * branch than the original one, then update
-				 * the mnt counts of the old and new
+				 * branch than the original one, and this
+				 * was due to a new branch inserted, then
+				 * update the mnt counts of the old and new
 				 * branches accordingly.
 				 */
 				unionfs_mntget(dentry, bstart);	/* new branch */


More information about the unionfs-cvs mailing list