Revert "Revert "Android: sdcardfs: Don't do d_add for lower fs""

This reverts commit ffa75fdb9c408f49b9622b6d55752ed99ff61488.

Turns out we just needed the right hash.

Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 37231161
Change-Id: I6a6de7f7df99ad42b20fa062913b219f64020c31
This commit is contained in:
Daniel Rosenberg 2017-04-20 18:21:50 -07:00 committed by LuK1337
parent 200b4c841b
commit 8b502bb89e
1 changed files with 5 additions and 7 deletions

View File

@ -373,17 +373,15 @@ put_name:
lower_dentry = d_hash_and_lookup(lower_dir_dentry, &dname);
if (IS_ERR(lower_dentry))
return lower_dentry;
if (lower_dentry)
goto setup_lower;
lower_dentry = d_alloc(lower_dir_dentry, &dname);
if (!lower_dentry) {
err = -ENOMEM;
/* We called vfs_path_lookup earlier, and did not get a negative
* dentry then. Don't confuse the lower filesystem by forcing
* one on it now...
*/
err = -ENOENT;
goto out;
}
d_add(lower_dentry, NULL); /* instantiate and hash */
setup_lower:
lower_path.dentry = lower_dentry;
lower_path.mnt = mntget(lower_dir_mnt);
sdcardfs_set_lower_path(dentry, &lower_path);