linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Su Hui <suhui@nfschina.com>, jaegeuk@kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: avoid format-overflow warning
Date: Sun, 8 Oct 2023 14:45:23 +0800	[thread overview]
Message-ID: <88b26dc7-93c6-5c96-1bf8-2c2c320f3247@kernel.org> (raw)
In-Reply-To: <20231008063929.538425-1-suhui@nfschina.com>

On 2023/10/8 14:39, Su Hui wrote:
> With gcc and W=1 option, there's a warning like this:
> 
> fs/f2fs/compress.c: In function ‘f2fs_init_page_array_cache’:
> fs/f2fs/compress.c:1984:47: error: ‘%u’ directive writing between
> 1 and 7 bytes into a region of size between 5 and 8
> [-Werror=format-overflow=]
>   1984 |  sprintf(slab_name, "f2fs_page_array_entry-%u:%u", MAJOR(dev),
> 		MINOR(dev));
>        |                                               ^~
> 
> String "f2fs_page_array_entry-%u:%u" can up to 35. The first "%u" can up
> to 4 and the second "%u" can up to 7, so total size is "24 + 4 + 7 = 35".
> slab_name's size should be 35 rather than 32.
> 
> Signed-off-by: Su Hui <suhui@nfschina.com>

Looks good to me, thanks for the patch.

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,


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

           reply	other threads:[~2023-10-08  6:45 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20231008063929.538425-1-suhui@nfschina.com>]

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=88b26dc7-93c6-5c96-1bf8-2c2c320f3247@kernel.org \
    --to=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suhui@nfschina.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;
as well as URLs for NNTP newsgroup(s).