All of lore.kernel.org
 help / color / mirror / Atom feed
From: Coly Li <i@coly.li>
To: Robin Dong <sanbai@taobao.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH] fix incorrect error-message of ext2
Date: Sat, 23 Apr 2011 22:23:21 +0800	[thread overview]
Message-ID: <4DB2E0D9.7090009@coly.li> (raw)
In-Reply-To: <1303565818-19512-1-git-send-email-hao.bigrat@gmail.com>

On 2011年04月23日 21:36, Robin Dong Wrote:
> From: Robin Dong <sanbai@taobao.com>
> 
> After "mkfs.ext2 -b 8192" on a new partition, I mount it with a error dmesg:
> "error: blocksize is too small"
> That's not correct.
> 

Agree, it should be too big, or invalid block size.

> Signed-off-by: Robin Dong <sanbai@taobao.com>
[snip]
> +	hblock = bdev_logical_block_size(sb->s_bdev);
>  	/* If the blocksize doesn't match, re-read the thing.. */
>  	if (sb->s_blocksize != blocksize) {
> +		/*
> +		 * Make sure the blocksize for the filesystem is larger
> +		 * than the hardware sectorsize for the machine.
> +		 */
> +		if (blocksize < hblock) {
> +			ext2_msg(sb, KERN_ERR,
> +				"error: fsblocksize %d too small for "
> +				"hardware sectorsize %d", blocksize, hblock);

When a file system is mounted, the reported underlying dev logical block size may be larger than a sector size.

> +			goto failed_mount;
> +		}
> +
>  		brelse(bh);
>  

How about just keeping bellowed lines ? Reporting bad block size number is the behavior how Ext3 and Ext4 do.

>  		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;
>  		}


-- 
Coly Li
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2011-04-23 13:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-23 13:36 [PATCH] fix incorrect error-message of ext2 Robin Dong
2011-04-23 14:10 ` Eric Sandeen
2011-04-23 14:23 ` Coly Li [this message]
2011-04-23 14:12   ` Eric Sandeen

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=4DB2E0D9.7090009@coly.li \
    --to=i@coly.li \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sanbai@taobao.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.