Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

f2fs: make is_multimedia_file code align with its name

The code conditions put inside the function is_multimedia_file are
reverse to the name i.e, we need to negate the return to actually
check if the file is a multimedia file. So, change the code and usage
path to align both the name and comparision conditions.

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>

authored by

Namjae Jeon and committed by
Jaegeuk Kim
e66509f0 66348b72

+4 -4
+4 -4
fs/f2fs/namei.c
··· 83 83 int ret; 84 84 85 85 if (sublen > slen) 86 - return 1; 86 + return 0; 87 87 88 88 ret = memcmp(s + slen - sublen, sub, sublen); 89 89 if (ret) { /* compare upper case */ ··· 91 91 char upper_sub[8]; 92 92 for (i = 0; i < sublen && i < sizeof(upper_sub); i++) 93 93 upper_sub[i] = toupper(sub[i]); 94 - return memcmp(s + slen - sublen, upper_sub, sublen); 94 + return !memcmp(s + slen - sublen, upper_sub, sublen); 95 95 } 96 96 97 - return ret; 97 + return !ret; 98 98 } 99 99 100 100 /* ··· 108 108 109 109 int count = le32_to_cpu(sbi->raw_super->extension_count); 110 110 for (i = 0; i < count; i++) { 111 - if (!is_multimedia_file(name, extlist[i])) { 111 + if (is_multimedia_file(name, extlist[i])) { 112 112 set_cold_file(inode); 113 113 break; 114 114 }