diff options
| author | Shuoran Liu <liushuoran@huawei.com> | 2016-08-25 20:42:09 +0800 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-13 12:34:00 +0200 |
| commit | fa263fa6fa38a58b205abf4f04a07a59ba6956f6 (patch) | |
| tree | cfa88fdc87a60b0681071ef6a3801172c5f1f5ec | |
| parent | 72b3318b53693ba6df4615e09249fc2a9522a6f4 (diff) | |
f2fs: fix a bug when using namehash to locate dentry bucket
In the following scenario,
1) we don't have the key and doing a lookup for encrypted file,
2) and the encrypted filename is big name
we should use fname->hash as name hash value instead of what is
calculated by fname->disk_name. Because in such case,
fname->disk_name is empty.
Signed-off-by: Shuoran Liu <liushuoran@huawei.com>
Acked-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| -rw-r--r-- | fs/f2fs/dir.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index e4a0e23cb..b032702c5 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -173,7 +173,10 @@ static struct f2fs_dir_entry *find_in_level(struct inode *dir, int max_slots; f2fs_hash_t namehash; - namehash = f2fs_dentry_hash(&name); + if(fname->hash) + namehash = cpu_to_le32(fname->hash); + else + namehash = f2fs_dentry_hash(&name); nbucket = dir_buckets(level, F2FS_I(dir)->i_dir_level); nblock = bucket_blocks(level); |
