linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: signedness bug in f2fs_fname_setup_ci_filename()
@ 2019-09-04 10:02 Dan Carpenter
  2019-09-04 11:43 ` Chao Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2019-09-04 10:02 UTC (permalink / raw)
  To: Jaegeuk Kim, Chao Yu; +Cc: kernel-janitors, linux-f2fs-devel

The error handling doesn't work because "cf_name->len" is unsigned.

Fixes: fbce5d4ab3ab ("f2fs: optimize case-insensitive lookups")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 fs/f2fs/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index 9de688a4e115..c83b666f9d7e 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -157,7 +157,7 @@ void f2fs_fname_setup_ci_filename(struct inode *dir,
 	cf_name->len = utf8_casefold(sbi->s_encoding,
 					iname, cf_name->name,
 					F2FS_NAME_LEN);
-	if (cf_name->len <= 0) {
+	if ((int)cf_name->len <= 0) {
 		kvfree(cf_name->name);
 		cf_name->name = NULL;
 	}
-- 
2.20.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: signedness bug in f2fs_fname_setup_ci_filename()
  2019-09-04 10:02 [f2fs-dev] [PATCH] f2fs: signedness bug in f2fs_fname_setup_ci_filename() Dan Carpenter
@ 2019-09-04 11:43 ` Chao Yu
  2019-09-04 12:44   ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Chao Yu @ 2019-09-04 11:43 UTC (permalink / raw)
  To: Dan Carpenter, Jaegeuk Kim; +Cc: kernel-janitors, linux-f2fs-devel

On 2019/9/4 18:02, Dan Carpenter wrote:
> The error handling doesn't work because "cf_name->len" is unsigned.

Dan, thanks for catching this, would you mind merging this into original patch,
since it's still in the dev branch. :)

Thanks,

> 
> Fixes: fbce5d4ab3ab ("f2fs: optimize case-insensitive lookups")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  fs/f2fs/dir.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
> index 9de688a4e115..c83b666f9d7e 100644
> --- a/fs/f2fs/dir.c
> +++ b/fs/f2fs/dir.c
> @@ -157,7 +157,7 @@ void f2fs_fname_setup_ci_filename(struct inode *dir,
>  	cf_name->len = utf8_casefold(sbi->s_encoding,
>  					iname, cf_name->name,
>  					F2FS_NAME_LEN);
> -	if (cf_name->len <= 0) {
> +	if ((int)cf_name->len <= 0) {
>  		kvfree(cf_name->name);
>  		cf_name->name = NULL;
>  	}
> 


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: signedness bug in f2fs_fname_setup_ci_filename()
  2019-09-04 11:43 ` Chao Yu
@ 2019-09-04 12:44   ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2019-09-04 12:44 UTC (permalink / raw)
  To: Chao Yu; +Cc: Jaegeuk Kim, kernel-janitors, linux-f2fs-devel

On Wed, Sep 04, 2019 at 07:43:07PM +0800, Chao Yu wrote:
> On 2019/9/4 18:02, Dan Carpenter wrote:
> > The error handling doesn't work because "cf_name->len" is unsigned.
> 
> Dan, thanks for catching this, would you mind merging this into original patch,
> since it's still in the dev branch. :)

I don't mind if you fold it into the original.  That's fine.

regards,
dan carpenter



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-04 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04 10:02 [f2fs-dev] [PATCH] f2fs: signedness bug in f2fs_fname_setup_ci_filename() Dan Carpenter
2019-09-04 11:43 ` Chao Yu
2019-09-04 12:44   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).