Skip to content

Commit

Permalink
ext2: fix error msg when mounting fs with too-large blocksize
Browse files Browse the repository at this point in the history
When ext2 mounts a filesystem, it attempts to set the block device
blocksize with a call to sb_set_blocksize, which can fail for
several reasons.  The current failure message in ext2 prints:

  EXT2-fs (loop1): error: blocksize is too small

which is not correct in all cases.  This can be demonstrated
by creating a filesystem with

  # mkfs.ext2 -b 8192

on a 4k page system, and attempting to mount it.

Change the error message to a more generic:

  EXT2-fs (loop1): bad blocksize 8192

to match the error message in ext3.

Signed-off-by: Robin Dong <sanbai@taobao.com>
Reviewed-by: Coly Li <bosong.ly@taobao.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
  • Loading branch information
Robin Dong authored and Jan Kara committed May 17, 2011
1 parent d9b0193 commit 4e299c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/ext2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,8 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
brelse(bh);

if (!sb_set_blocksize(sb, blocksize)) {
ext2_msg(sb, KERN_ERR, "error: blocksize is too small");
ext2_msg(sb, KERN_ERR,
"error: bad blocksize %d", blocksize);
goto failed_sbi;
}

Expand Down

0 comments on commit 4e299c1

Please sign in to comment.