linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: Fix incorrect inodes per group in error message
@ 2020-03-28 22:34 Josh Triplett
  2020-03-28 22:57 ` Andreas Dilger
  2020-03-29  2:29 ` Theodore Y. Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: Josh Triplett @ 2020-03-28 22:34 UTC (permalink / raw)
  To: linux-ext4, linux-kernel; +Cc: Theodore Ts'o, Andreas Dilger

If ext4_fill_super detects an invalid number of inodes per group, the
resulting error message printed the number of blocks per group, rather
than the number of inodes per group. Fix it to print the correct value.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Fixes: cd6bb35bf7f6d ("ext4: use more strict checks for inodes_per_block on mount")
---
 fs/ext4/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 0c7c4adb664e..c50922fa780a 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4157,7 +4157,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 	if (sbi->s_inodes_per_group < sbi->s_inodes_per_block ||
 	    sbi->s_inodes_per_group > blocksize * 8) {
 		ext4_msg(sb, KERN_ERR, "invalid inodes per group: %lu\n",
-			 sbi->s_blocks_per_group);
+			 sbi->s_inodes_per_group);
 		goto failed_mount;
 	}
 	sbi->s_itb_per_group = sbi->s_inodes_per_group /
-- 
2.26.0


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

* Re: [PATCH] ext4: Fix incorrect inodes per group in error message
  2020-03-28 22:34 [PATCH] ext4: Fix incorrect inodes per group in error message Josh Triplett
@ 2020-03-28 22:57 ` Andreas Dilger
  2020-03-29  2:29 ` Theodore Y. Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Dilger @ 2020-03-28 22:57 UTC (permalink / raw)
  To: Josh Triplett; +Cc: linux-ext4, linux-kernel, Theodore Ts'o, Andreas Dilger

[-- Attachment #1: Type: text/plain, Size: 1215 bytes --]

On Mar 28, 2020, at 4:34 PM, Josh Triplett <josh@joshtriplett.org> wrote:
> 
> If ext4_fill_super detects an invalid number of inodes per group, the
> resulting error message printed the number of blocks per group, rather
> than the number of inodes per group. Fix it to print the correct value.
> 
> Signed-off-by: Josh Triplett <josh@joshtriplett.org>
> Fixes: cd6bb35bf7f6d ("ext4: use more strict checks for inodes_per_block on mount")

LGTM

Reviewed-by: Andreas Dilger <adilger@dilger.ca>

> ---
> fs/ext4/super.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 0c7c4adb664e..c50922fa780a 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -4157,7 +4157,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
> 	if (sbi->s_inodes_per_group < sbi->s_inodes_per_block ||
> 	    sbi->s_inodes_per_group > blocksize * 8) {
> 		ext4_msg(sb, KERN_ERR, "invalid inodes per group: %lu\n",
> -			 sbi->s_blocks_per_group);
> +			 sbi->s_inodes_per_group);
> 		goto failed_mount;
> 	}
> 	sbi->s_itb_per_group = sbi->s_inodes_per_group /
> --
> 2.26.0
> 


Cheers, Andreas






[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]

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

* Re: [PATCH] ext4: Fix incorrect inodes per group in error message
  2020-03-28 22:34 [PATCH] ext4: Fix incorrect inodes per group in error message Josh Triplett
  2020-03-28 22:57 ` Andreas Dilger
@ 2020-03-29  2:29 ` Theodore Y. Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Theodore Y. Ts'o @ 2020-03-29  2:29 UTC (permalink / raw)
  To: Josh Triplett; +Cc: linux-ext4, linux-kernel, Andreas Dilger

On Sat, Mar 28, 2020 at 03:34:15PM -0700, Josh Triplett wrote:
> If ext4_fill_super detects an invalid number of inodes per group, the
> resulting error message printed the number of blocks per group, rather
> than the number of inodes per group. Fix it to print the correct value.
> 
> Signed-off-by: Josh Triplett <josh@joshtriplett.org>
> Fixes: cd6bb35bf7f6d ("ext4: use more strict checks for inodes_per_block on mount")

Applied, thanks.

						- Ted

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

end of thread, other threads:[~2020-03-29  2:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-28 22:34 [PATCH] ext4: Fix incorrect inodes per group in error message Josh Triplett
2020-03-28 22:57 ` Andreas Dilger
2020-03-29  2:29 ` Theodore Y. Ts'o

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).