RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2064810 - RFE: complete libblkid FSSIZE implementation
Summary: RFE: complete libblkid FSSIZE implementation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: util-linux
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Karel Zak
QA Contact: Radka Brychtova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-16 15:41 UTC by David Teigland
Modified: 2022-11-15 13:22 UTC (History)
4 users (show)

Fixed In Version: util-linux-2.37.4-8.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-15 11:23:24 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-115763 0 None None None 2022-03-16 16:42:58 UTC
Red Hat Product Errata RHBA-2022:8404 0 None None None 2022-11-15 11:23:32 UTC

Description David Teigland 2022-03-16 15:41:21 UTC
Description of problem:

FSSIZE has not bee fully implemented for specific file systems (by reading on-disk structures.)  I'd like to use it in lvreduce (bug 1878893).

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Eric Sandeen 2022-03-16 16:34:43 UTC
Sure, I'll see if someone on our team can work on this, should not be a major effort.

Comment 3 David Teigland 2022-03-17 15:53:31 UTC
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.

Comment 4 Eric Sandeen 2022-03-17 16:16:28 UTC
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

Comment 5 Karel Zak 2022-03-18 09:39:21 UTC
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).

Comment 6 Andrey Albershteyn (aalbersh) 2022-05-05 09:48:53 UTC
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.

Comment 8 David Teigland 2022-05-23 22:14:57 UTC
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?

Comment 9 Karel Zak 2022-05-25 07:39:47 UTC
Andrey, I guess FSLASTBLOCK is counted in BLOCK_SIZE, right?

Comment 10 Andrey Albershteyn (aalbersh) 2022-05-26 09:28:43 UTC
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.

Comment 11 Andrey Albershteyn (aalbersh) 2022-05-31 09:22:42 UTC
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

Comment 17 errata-xmlrpc 2022-11-15 11:23:24 UTC
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


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