Bug 594063 - the block size specified can't be accepted when more than the min(logical, physical)
Summary: the block size specified can't be accepted when more than the min(logical, ph...
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: e2fsprogs
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Eric Sandeen
QA Contact: BaseOS QE - Apps
Depends On:
TreeView+ depends on / blocked
Reported: 2010-05-20 13:15 UTC by yanfu,wang
Modified: 2010-05-24 08:54 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-05-24 08:54:31 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description yanfu,wang 2010-05-20 13:15:35 UTC
Description of problem:
an explicit block size should be rejected if less than the min(logical, physical). But when the block size specified more than the min(logical, physical), it's still can't be accept. 

Version-Release number of selected component (if applicable):
root@nec-em18 ~]# uname -a
Linux nec-em18.rhts.eng.bos.redhat.com 2.6.32-19.el6.x86_64 #1 SMP Tue Mar 9
17:48:46 EST 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@nec-em18 ~]# rpm -qa|grep e2fsprogs

How reproducible:

Steps to Reproduce:
[root@nec-em18 ~]# modprobe scsi_debug dev_size_mb=200 sector_size=2048
physblk_exp=3 lowest_aligned=7

[root@nec-em18 ~]# cat /sys/block/sdb/queue/physical_block_size 
[root@nec-em18 ~]# cat /sys/block/sdb/queue/logical_block_size 

[root@nec-em18 ~]# mkfs.ext4 -b 4096 /dev/sdb
mke2fs 1.41.12 (17-May-2010)
mkfs.ext4: Invalid argument while setting blocksize; too small for device

[root@nec-em18 ~]# mkfs.ext4 -b 2048 /dev/sdb
mkfs.ext4: Invalid argument while setting blocksize; too small for device

Actual results:

Expected results:

Additional info:

Comment 1 RHEL Program Management 2010-05-20 13:36:51 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for

Comment 2 Eric Sandeen 2010-05-20 17:01:41 UTC
Ok, this actually was somewhat intentional.

        } else {
                if (blocksize < lsector_size ||                 /* Impossible */
                    (!force && (blocksize < psector_size))) {   /* Suboptimal */
                        com_err(program_name, EINVAL,
                                _("while setting blocksize; too small "
                                  "for device\n"));
                } else if (blocksize < psector_size) {
                        fprintf(stderr, _("Warning: specified blocksize %d is "
                                "less than device physical sectorsize %d, "
                                "forced to continue\n"), blocksize,

When specifying a block size which is less than the physical block size of the device, performance will likely suffer badly.  Therefore, unless -F is given, we don't continue.

If you think there is a valid reason to allow this and not require the -F force flag, let me know, otherwise I think things are working as designed.


Comment 3 yanfu,wang 2010-05-21 05:45:01 UTC
I test it on e2fsprogs-1.41.10-3.el6.x86_64 again using the same steps, it can mkfs successfully by specify the block size without -F given, but I think the current adjust is ok. I'll close the bug if there isn't sth. need to do.

Note You need to log in before you can comment on or make changes to this bug.