Bug 2064810
Summary: | RFE: complete libblkid FSSIZE implementation | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | David Teigland <teigland> |
Component: | util-linux | Assignee: | Karel Zak <kzak> |
Status: | CLOSED ERRATA | QA Contact: | Radka Brychtova <rskvaril> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 9.0 | CC: | aalbersh, dwysocha, esandeen, kzak |
Target Milestone: | rc | Keywords: | FutureFeature, Triaged |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | util-linux-2.37.4-8.el9 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2022-11-15 11:23:24 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
David Teigland
2022-03-16 15:41:21 UTC
Sure, I'll see if someone on our team can work on this, should not be a major effort. After talking with Eric, it sounds like FSSIZE is already closely associated with statfs values (e.g. in lsblk), so FSSIZE should probably be emulating the statfs values. However, for our purposes in bug 1878893, we actually need to know the last block on the device used by the fs. That seems like a new property with a name like FSLASTBLOCK or FSBLOCKCOUNT. Yup - FSSIZE in lsblk is reporting dev->fsstat.f_frsize * dev->fsstat.f_blocks, and filesystems tend to exclude internal metadata blocks for that; it's more like "total data blocks" and often excludes i.e. the log, etc. And surely blkid FSSIZE should match lsblk's FSSIZE. So while FSSIZE is still interesting and useful for blkid, I think we might want to add something like FSLASTBLOCK as well, depending on what kzak thinks about it. Thanks, -Eric libblkid is completely open for arbitrary variables, we can introduce whatever you need :-) I like both, FSSIZE (in statfs meaning) as well as FSLASTBLOCK (for the size of the area occupated by FS). The FSLASTBLOCK and FSSIZE tags were merged into util-linux. Both tags are implemented for XFS. FSLASTBLOCK is implemented for ext2/3/4/jbd and btrfs. I'll implement FSSIZE for ext and btrfs, later. FSSIZE - mimics statfs + lsblk's FSSIZE (total_blocks*block_size - fs_overhead). However, in case of ext and btrfs it would be just total_blocks*block_size. FSLASTBLOCK - area occupied by FS, number of the last block of FS. Both these tags could be enabled by BLKID_SUBLKS_FSINFO flag. Hi, I've begun adding some lvm code to use this, and the units of FSLASTBLOCK are not immediately clear to me. From what I'm seeing, it seems likely they are units of the fs block size, but the fs block size doesn't seem to be exposed in blkid. The BLOCK_SIZE (512 or 4096) is available, but this doesn't quite look like it's what I need here. Perhaps the units of FSLASTBLOCK could be changed to BLOCK_SIZE (or bytes), or the FSBLOCKSIZE could be added? Andrey, I guess FSLASTBLOCK is counted in BLOCK_SIZE, right? Hey, the FSLASTBLOCK is in fs block size units. The XFS implementation sets BLOCK_SIZE to the sector size (which is intended). I will work on adding FSBLOCKSIZE tag which would expose fs block size. Hey David, the FSBLOCKSIZE was merged into util-linux. Now you should be able to do FSLASTBLOCK*FSBLOCKSIZE to get a fs size. Relevant upstream patches: 895f0b609 libblkid: update documentation of BLOCK_SIZE tag 0f447d490 libblkid: add FSBLOCKSIZE tag Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (util-linux bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2022:8404 |