All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: i@coly.li
Cc: Robin Dong <sanbai@taobao.com>, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] fix incorrect error-message of ext2
Date: Sat, 23 Apr 2011 09:12:14 -0500	[thread overview]
Message-ID: <4DB2DE3E.2090704@redhat.com> (raw)
In-Reply-To: <4DB2E0D9.7090009@coly.li>

On 4/23/11 9:23 AM, Coly Li wrote:
> 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.

True, but set_blocksize will fail it:

        /* Size cannot be smaller than the size supported by the device */
        if (size < bdev_logical_block_size(bdev))
                return -EINVAL;

Above patch is really just repeating this test.

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

Agreed, this change makes it consistent with ext3, and I think that it is enough.

Thanks,
-Eric
--
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

      reply	other threads:[~2011-04-23 14:12 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
2011-04-23 14:12   ` Eric Sandeen [this message]

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=4DB2DE3E.2090704@redhat.com \
    --to=sandeen@redhat.com \
    --cc=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.