lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 23 Apr 2011 22:23:21 +0800
From:	Coly Li <i@...y.li>
To:	Robin Dong <sanbai@...bao.com>
CC:	linux-ext4@...r.kernel.org
Subject: Re: [PATCH] fix incorrect error-message of ext2

On 2011年04月23日 21:36, Robin Dong Wrote:
> From: Robin Dong <sanbai@...bao.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@...bao.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists