commit 54d2f4a8b4913488de8715a01f3729bc33692f3b
Author: Rachita Kothiyal <[EMAIL PROTECTED]>
Date: Sun Nov 25 16:28:45 2007 -0500
Unionfs: Fix an OOPs in whiteout lookup
Pass the dbstart of the parent and get the correct lower dentry of the
parent. We need the parent's lower dentry so that we can lookup the
child(whiteout) and find the child's lower dentry too.
Signed-off-by: Rachita Kothiyal([EMAIL PROTECTED])
diff --git a/fs/unionfs/lookup.c b/fs/unionfs/lookup.c
index 2b156d6..d939b5d 100644
--- a/fs/unionfs/lookup.c
+++ b/fs/unionfs/lookup.c
@@ -114,7 +114,7 @@ struct dentry *unionfs_lookup_backend(struct dentry *dentry,
if (UNIONFS_D(dentry)->odf.dentry) {
/* return negative dentry if a whiteout */
if (UNIONFS_D(dentry)->odf.whiteout) {
- bindex = 0;
+ bindex = bstart;
goto out_negative;
}
/* if opaque dir lookup only until opaque branch */
@@ -240,6 +240,15 @@ out_negative:
}
/* This should only happen if we found a whiteout. */
if (first_dentry_offset == -1) {
+ /*
+ * If we are a whiteout, we haven't filled up lower_dir_dentry
+ * at all, so this is NULL at this point. Fill this up now.
+ * Note, this was why we needed to pass the right bindex from
+ * above.
+ */
+ if (!lower_dir_dentry)
+ lower_dir_dentry =
+ unionfs_lower_dentry_idx(parent_dentry, bindex);
first_lower_dentry = lookup_one_len(name, lower_dir_dentry,
namelen);
first_dentry_offset = bindex;
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs