Bug 1684078
| Summary: | blockdev –-getbsz forever return 4096. | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | izyk <linux> |
| Component: | util-linux | Assignee: | Karel Zak <kzak> |
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | jcall, jonathan, kzak, yaneti |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-02-28 13:00:46 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
izyk
2019-02-28 11:23:15 UTC
Linux kernel provides three basic ioctls:
case BLKBSZGET: /* get block device soft block size (cf. BLKSSZGET) */
return put_int(arg, block_size(bdev));
case BLKSSZGET: /* get block device logical block size */
return put_int(arg, bdev_logical_block_size(bdev));
case BLKPBSZGET: /* get block device physical block size */
--getbsz means BLKBSZGET.
This size does not describes the device from "topology" point of view (like logical or physical sector), but it's block used internally by kernel for the device.
It's for example on the fly modified by filesystem. See "mkfs.ext4 -b <size>" (default is 4KiB). You can also change from userspace by --setbsz (but the setting is valid only for the open descriptor). I'll add more information to the upstream blockdev.8 man page to make it more obvios.
So, not a bug. Although at first glance it seems strange :-)
Example: # mkfs.ext4 -b $((2 * 1024)) /dev/sdc # blockdev --getbsz /dev/sdc 4096 # mount /dev/sdc /mnt/test # blockdev --getbsz /dev/sdc 2048 # umount /mnt/test # blockdev --getbsz /dev/sdc 4096 Note that the default is usually 4096 due to system PAGE_SIZE. Oh. Maybe you can add new parameter for more obvious. --getlbsz - Get logical block (sector) size. Physical disk. See BLKSSZGET analog of: --getpbsz - Get physical block (sector) size. Physical disk. See BLKPBSZGET --getbsz - Print blocksize in bytes. Used inside kernel. See BLKBSZGET Or something similar. Thank you. |