From: Daniel Rosenberg Date: Fri, 21 Apr 2017 01:05:02 +0000 (-0700) Subject: ANDROID: sdcardfs: Use filesystem specific hash X-Git-Tag: release-20171130_firefly~4^2~100^2~130 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9b2a5cdae059228e8039c0a779c4b77006b79438;p=firefly-linux-kernel-4.4.55.git ANDROID: sdcardfs: Use filesystem specific hash We weren't accounting for FS specific hash functions, causing us to miss negative dentries for any FS that had one. Similar to a patch from esdfs commit 75bd25a9476d ("esdfs: support lower's own hash") Signed-off-by: Daniel Rosenberg Change-Id: I32d1ba304d728e0ca2648cacfb4c2e441ae63608 --- diff --git a/fs/sdcardfs/lookup.c b/fs/sdcardfs/lookup.c index a0f221501b4c..446ef4027ebc 100644 --- a/fs/sdcardfs/lookup.c +++ b/fs/sdcardfs/lookup.c @@ -366,8 +366,13 @@ put_name: /* instatiate a new negative dentry */ dname.name = name->name; dname.len = name->len; - dname.hash = full_name_hash(dname.name, dname.len); - lower_dentry = d_lookup(lower_dir_dentry, &dname); + + /* See if the low-level filesystem might want + * to use its own hash + */ + lower_dentry = d_hash_and_lookup(lower_dir_dentry, &dname); + if (IS_ERR(lower_dentry)) + return lower_dentry; if (lower_dentry) goto setup_lower;