From: Rachita Kothiyal Date: Sun, 25 Nov 2007 21:28:45 +0000 (-0500) Subject: Unionfs: Fix an OOPs in whiteout lookup X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=54d2f4a8b4913488de8715a01f3729bc33692f3b;p=unionfs-odf.git 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(rachita@fsl.cs.sunysb.edu) --- diff --git a/fs/unionfs/lookup.c b/fs/unionfs/lookup.c index 2b156d6c94..d939b5d92a 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;