Unionfs: force only one open lower file after copyup in open(2)
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 6 Sep 2011 01:36:50 +0000 (21:36 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 6 Sep 2011 01:36:50 +0000 (21:36 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/commonfops.c

index 1301074407e69f0de753af12203d359e16094dc7..b154ccc95e19a734825cde79e9765acdd0755710 100644 (file)
@@ -505,8 +505,11 @@ static int __open_file(struct inode *inode, struct file *file,
                        for (bindex = bstart - 1; bindex >= 0; bindex--) {
                                err = copyup_file(parent->d_inode, file,
                                                  bstart, bindex, size);
-                               if (!err)
+                               if (!err) {
+                                       /* only one regular file open */
+                                       fbend(file) = fbstart(file);
                                        break;
+                               }
                        }
                        return err;
                } else {