commit 56bfee34e6c0b20c5dabe772adff22516309543a
Author: Erez Zadok <[EMAIL PROTECTED]>
Date: Fri Feb 15 21:38:30 2008 -0500
Unionfs: ensure consistent lower inodes types
When looking up a lower object in multiple branches, especially for
directories, ignore any existing entries whose type is different than the
type of the first found object (otherwise we'll be trying to, say, call
readdir on a non-dir inode).
Signed-off-by: Himanshu Kanda <[EMAIL PROTECTED]>
Signed-off-by: Erez Zadok <[EMAIL PROTECTED]>
diff --git a/fs/unionfs/lookup.c b/fs/unionfs/lookup.c
index 377f9d0..228187b 100644
--- a/fs/unionfs/lookup.c
+++ b/fs/unionfs/lookup.c
@@ -261,6 +261,19 @@ struct dentry *unionfs_lookup_backend(struct dentry
*dentry,
continue;
}
+ /*
+ * If we already found at least one positive dentry
+ * (dentry_count is non-zero), then we skip all remaining
+ * positive dentries if their type is a non-dir. This is
+ * because only directories are allowed to stack on multiple
+ * branches, but we have to skip non-dirs (to avoid, say,
+ * calling readdir on a regular file).
+ */
+ if (!S_ISDIR(lower_dentry->d_inode->i_mode) && dentry_count) {
+ dput(lower_dentry);
+ continue;
+ }
+
/* number of positive dentries */
dentry_count++;
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs