diff options
| author | Robin Dong <hao.bigrat@gmail.com> | 2011-05-04 22:44:04 -0400 |
|---|---|---|
| committer | Jan Kara <jack@suse.cz> | 2011-05-17 07:47:42 -0400 |
| commit | 4e299c1d9113b5c1c3845c0d4e78d09dd60a4fe8 (patch) | |
| tree | 24d209ff8fe59ec0e43fd88be35f45bd687bc975 | |
| parent | d9b01934d56a96d9f4ae2d6204d4ea78a36f5f36 (diff) | |
ext2: fix error msg when mounting fs with too-large blocksize
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>
| -rw-r--r-- | fs/ext2/super.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 0a78dae7e2c..1dd62ed35b8 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
| @@ -898,7 +898,8 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) | |||
| 898 | brelse(bh); | 898 | brelse(bh); |
| 899 | 899 | ||
| 900 | if (!sb_set_blocksize(sb, blocksize)) { | 900 | if (!sb_set_blocksize(sb, blocksize)) { |
| 901 | ext2_msg(sb, KERN_ERR, "error: blocksize is too small"); | 901 | ext2_msg(sb, KERN_ERR, |
| 902 | "error: bad blocksize %d", blocksize); | ||
| 902 | goto failed_sbi; | 903 | goto failed_sbi; |
| 903 | } | 904 | } |
| 904 | 905 | ||
