Re: [PATCH] fix incorrect error-message of ext2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2011å04æ23æ 21:36, Robin Dong Wrote:
> From: Robin Dong <sanbai@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
[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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux