Bug 594063 - the block size specified can't be accepted when more than the min(logical, physical)
the block size specified can't be accepted when more than the min(logical, ph...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: e2fsprogs (Show other bugs)
6.0
All Linux
medium Severity medium
: rc
: ---
Assigned To: Eric Sandeen
BaseOS QE - Apps
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-20 09:15 EDT by yanfu,wang
Modified: 2010-05-24 04:54 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-05-24 04:54:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description yanfu,wang 2010-05-20 09:15:35 EDT
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
e2fsprogs-libs-1.41.12-1.el6.x86_64
e2fsprogs-1.41.12-1.el6.x86_64

How reproducible:
always

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 
16384
[root@nec-em18 ~]# cat /sys/block/sdb/queue/logical_block_size 
2048

[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 Product and Program Management 2010-05-20 09:36:51 EDT
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
inclusion.
Comment 2 Eric Sandeen 2010-05-20 13:01:41 EDT
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"));
                        exit(1);
                } else if (blocksize < psector_size) {
                        fprintf(stderr, _("Warning: specified blocksize %d is "
                                "less than device physical sectorsize %d, "
                                "forced to continue\n"), blocksize,
                                psector_size);
                }

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.

-Eric
Comment 3 yanfu,wang 2010-05-21 01:45:01 EDT
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.