Commit 3304b564 authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: fix wrong casting for dentry name

The dentry name type is unsigned char *.
If we don't match this type, some character codes can be changed by signed bit.
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 922cedbd
...@@ -42,7 +42,8 @@ static void TEA_transform(unsigned int buf[4], unsigned int const in[]) ...@@ -42,7 +42,8 @@ static void TEA_transform(unsigned int buf[4], unsigned int const in[])
buf[1] += b1; buf[1] += b1;
} }
static void str2hashbuf(const char *msg, size_t len, unsigned int *buf, int num) static void str2hashbuf(const unsigned char *msg, size_t len,
unsigned int *buf, int num)
{ {
unsigned pad, val; unsigned pad, val;
int i; int i;
...@@ -73,9 +74,9 @@ f2fs_hash_t f2fs_dentry_hash(const struct qstr *name_info) ...@@ -73,9 +74,9 @@ f2fs_hash_t f2fs_dentry_hash(const struct qstr *name_info)
{ {
__u32 hash; __u32 hash;
f2fs_hash_t f2fs_hash; f2fs_hash_t f2fs_hash;
const char *p; const unsigned char *p;
__u32 in[8], buf[4]; __u32 in[8], buf[4];
const char *name = name_info->name; const unsigned char *name = name_info->name;
size_t len = name_info->len; size_t len = name_info->len;
if ((len <= 2) && (name[0] == '.') && if ((len <= 2) && (name[0] == '.') &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment