* [PATCH v2] zonefs: Fix the wrong format specifier
@ 2024-12-09 2:52 Zhu Jun
2024-12-09 4:47 ` Damien Le Moal
0 siblings, 1 reply; 2+ messages in thread
From: Zhu Jun @ 2024-12-09 2:52 UTC (permalink / raw)
To: dlemoal; +Cc: linux-fsdevel, linux-kernel, zhujun2
Change f to unsigned int to resolve the mismatch in format specifiers for
snprintf(), where %u should be used for unsigned integers instead of %d
Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
---
Changes:
v2:
A better fix is to make f "unsigned int" as that is consistent with
g_nr_zones and the fact that up to "unsigned int" total number of zones are
allowed for a zoned device.
Can you send a v2 ? Also please add a Fixes tag.
fs/zonefs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
index faf1eb878..695da258a 100644
--- a/fs/zonefs/super.c
+++ b/fs/zonefs/super.c
@@ -791,7 +791,7 @@ static int zonefs_readdir_zgroup(struct file *file,
int fname_len;
char *fname;
ino_t ino;
- int f;
+ unsigned int f;
/*
* The size of zone group directories is equal to the number
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] zonefs: Fix the wrong format specifier
2024-12-09 2:52 [PATCH v2] zonefs: Fix the wrong format specifier Zhu Jun
@ 2024-12-09 4:47 ` Damien Le Moal
0 siblings, 0 replies; 2+ messages in thread
From: Damien Le Moal @ 2024-12-09 4:47 UTC (permalink / raw)
To: Zhu Jun; +Cc: linux-fsdevel, linux-kernel
On 12/9/24 11:52, Zhu Jun wrote:
> Change f to unsigned int to resolve the mismatch in format specifiers for
> snprintf(), where %u should be used for unsigned integers instead of %d
>
> Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
The patch title is now wrong... And you forgot to add a Fixes tag.
Will fix that when applying. Thanks.
> ---
> Changes:
> v2:
> A better fix is to make f "unsigned int" as that is consistent with
> g_nr_zones and the fact that up to "unsigned int" total number of zones are
> allowed for a zoned device.
>
> Can you send a v2 ? Also please add a Fixes tag.
>
> fs/zonefs/super.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
> index faf1eb878..695da258a 100644
> --- a/fs/zonefs/super.c
> +++ b/fs/zonefs/super.c
> @@ -791,7 +791,7 @@ static int zonefs_readdir_zgroup(struct file *file,
> int fname_len;
> char *fname;
> ino_t ino;
> - int f;
> + unsigned int f;
>
> /*
> * The size of zone group directories is equal to the number
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-12-09 4:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-09 2:52 [PATCH v2] zonefs: Fix the wrong format specifier Zhu Jun
2024-12-09 4:47 ` Damien Le Moal
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®