From: Chao Yu <chao@kernel.org>
To: Shuoran Liu <liushuoran@huawei.com>, jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix a bug when using namehash to locate dentry bucket
Date: Thu, 25 Aug 2016 22:13:31 +0800 [thread overview]
Message-ID: <b77fe368-8e6e-3130-1078-b2eb3e2492e4@kernel.org> (raw)
In-Reply-To: <1472128929-86774-1-git-send-email-liushuoran@huawei.com>
On 2016/8/25 20:42, Shuoran Liu wrote:
> 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.
Your signiture is missing here.
Anyway that's a good catch!
Acked-by: Chao Yu <yuchao0@huawei.com>
> ---
> fs/f2fs/dir.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
> index 9054aea..b3e6f7f 100644
> --- a/fs/f2fs/dir.c
> +++ b/fs/f2fs/dir.c
> @@ -172,7 +172,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);
>
prev parent reply other threads:[~2016-08-25 14:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-25 12:42 Shuoran Liu
2016-08-25 14:13 ` Chao Yu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b77fe368-8e6e-3130-1078-b2eb3e2492e4@kernel.org \
--to=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liushuoran@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®