summaryrefslogtreecommitdiff
path: root/fs/f2fs/hash.c
diff options
context:
space:
mode:
authorNamjae Jeon <namjae.jeon@samsung.com>2012-12-13 14:44:11 (GMT)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2012-12-26 01:39:52 (GMT)
commit38e0abdcfb5e69aa61a1e9b474d434afc1c177a9 (patch)
tree3e221e1dda048aa5c087a7d88e9ba93e987be748 /fs/f2fs/hash.c
parent1362b5e347e27102ea0fa99c9932bca1ecde330f (diff)
downloadlinux-38e0abdcfb5e69aa61a1e9b474d434afc1c177a9.tar.xz
f2fs: fix up f2fs_get_parent issue to retrieve correct parent inode number
Test Case: [NFS Client] ls -lR . [NFS Server] while [ 1 ] do echo 3 > /proc/sys/vm/drop_caches done Error on NFS Client: "No such file or directory" When cache is dropped at the server, it results in lookup failure at the NFS client due to non-connection with the parent. The default path is it initiates a lookup by calculating the hash value for the name, even though the hash values stored on the disk for "." and ".." is maintained as zero, which results in failure from find_in_block due to not matching HASH values. Fix up, by using the correct hashing values for these entries. Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/hash.c')
-rw-r--r--fs/f2fs/hash.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/f2fs/hash.c b/fs/f2fs/hash.c
index a60f042..5e48bac 100644
--- a/fs/f2fs/hash.c
+++ b/fs/f2fs/hash.c
@@ -76,6 +76,10 @@ f2fs_hash_t f2fs_dentry_hash(const char *name, int len)
const char *p;
__u32 in[8], buf[4];
+ if ((len <= 2) && (name[0] == '.') &&
+ (name[1] == '.' || name[1] == '\0'))
+ return 0;
+
/* Initialize the default seed for the hash checksum functions */
buf[0] = 0x67452301;
buf[1] = 0xefcdab89;