Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2024022

Summary: xfs-admin: Cannot disable lazy-counters on V5 fs
Product: Red Hat Enterprise Linux 9 Reporter: YongkuiGuo <yoguo>
Component: libguestfsAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED ERRATA QA Contact: YongkuiGuo <yoguo>
Severity: low Docs Contact:
Priority: low    
Version: 9.0CC: kkiwi, lersek, rjones, virt-maint
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.46.0-5.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 12:28:37 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:
Attachments:
Description Flags
the whole log of guestfish none

Description YongkuiGuo 2021-11-17 03:05:43 UTC
Created attachment 1842239 [details]
the whole log of guestfish

Description of problem:
In guestfish, xfs-admin fails to disable lazy-counters on V5 fs.

Version-Release number of selected component (if applicable):
libguestfs-1.46.0-4.el9.x86_64
xfsprogs-5.0.0-9.el8.x86_64
kernel-5.14.0-12.el9.x86_64


How reproducible:
100%


Steps:

1. On rhel9 host
# guestfish -N fs:xfs xfs-admin /dev/sda1 lazycounter:false
libguestfs: error: xfs_admin: /dev/sda1: Running xfs_repair to upgrade filesystem.
Phase 1 - find and verify superblock...
Cannot disable lazy-counters on V5 fs


Actual results:
As above

Expected results:
xfs-admin can be able to disable lazy-counters on V5 fs.

Additional info:
The same issue on rhel8.6. File this bug as I noticed the upstream patch (627f808e4b0ab398a149c8d39ebe7157c38e67c7).

Comment 1 Laszlo Ersek 2021-11-17 11:20:13 UTC
Hello YongkuiGuo,

as explained in the message of upstream commit 627f808e4b0a, it is a characteristic of XFS v5 filesystems that lazy counters cannot be disabled in them. That fact is independent of libguestfs; you cannot disable lazy counters on XFSv5 with any other tool either. That's why the upstream commit removed such an attempt from the test suite too.

I don't think this is something we can "fix" in libguestfs; instead, the idea is "don't do this on XFSv5". (Basically, "NOTABUG".) But perhaps Rich has a better idea to make this more user friendly...

Comment 2 YongkuiGuo 2021-11-17 11:33:12 UTC
(In reply to Laszlo Ersek from comment #1)
> Hello YongkuiGuo,
> 
> as explained in the message of upstream commit 627f808e4b0a, it is a
> characteristic of XFS v5 filesystems that lazy counters cannot be disabled
> in them. That fact is independent of libguestfs; you cannot disable lazy
> counters on XFSv5 with any other tool either. That's why the upstream commit
> removed such an attempt from the test suite too.
> 
> I don't think this is something we can "fix" in libguestfs; instead, the
> idea is "don't do this on XFSv5". (Basically, "NOTABUG".) But perhaps Rich
> has a better idea to make this more user friendly...

Thanks for your explanation. Is it necessary to add the above details into guestfish man page?

Comment 3 Klaus Heinrich Kiwi 2021-11-17 14:25:07 UTC
(In reply to YongkuiGuo from comment #2)
> (In reply to Laszlo Ersek from comment #1)
> > Hello YongkuiGuo,
> > 
> > as explained in the message of upstream commit 627f808e4b0a, it is a
> > characteristic of XFS v5 filesystems that lazy counters cannot be disabled
> > in them. That fact is independent of libguestfs; you cannot disable lazy
> > counters on XFSv5 with any other tool either. That's why the upstream commit
> > removed such an attempt from the test suite too.
> > 
> > I don't think this is something we can "fix" in libguestfs; instead, the
> > idea is "don't do this on XFSv5". (Basically, "NOTABUG".) But perhaps Rich
> > has a better idea to make this more user friendly...
> 
> Thanks for your explanation. Is it necessary to add the above details into
> guestfish man page?

Perhaps a simple 'do operation x in case that is supported by the underlying filesystem'? I'm surprised if that rationale is not already used in the man page.

YongkuiGuo, do you have a specific section that looks incorrect?

Comment 4 YongkuiGuo 2021-11-18 03:13:18 UTC
(In reply to Klaus Heinrich Kiwi from comment #3)
> Perhaps a simple 'do operation x in case that is supported by the underlying
> filesystem'? I'm surprised if that rationale is not already used in the man
> page.
> 
> YongkuiGuo, do you have a specific section that looks incorrect?

# man guestfish
...
xfs-admin
    xfs-admin device [extunwritten:true|false] [imgfile:true|false] [v2log:true|false] [projid32bit:true|false] [lazycounter:true|false] ...

In the man page, lazycounter argument can be set as true or false. I wonder whether there should be a reminder to tell the user not to set 'lazycounter:false' on XFS v5 filesystem.

Comment 5 Laszlo Ersek 2021-11-18 13:24:01 UTC
I agree we should update the manual (but I defer to Rich). Newly created XFS disks will all have metadata CRC enabled by default (which is a good thing!), and so it will be less and less possible to disable "lazycounter".

Comment 6 Richard W.M. Jones 2021-11-22 15:12:14 UTC
I'm fairly sure we should just fix this by a little documentation:

https://listman.redhat.com/archives/libguestfs/2021-November/msg00205.html

Comment 10 YongkuiGuo 2021-11-24 10:12:16 UTC
Verified with package:
libguestfs-1.46.0-5.el9.x86_64

Steps:

1. On rhel9 host
# man guestfish
...
xfs-admin
    xfs-admin device [extunwritten:true|false] [imgfile:true|false] [v2log:true|false] [projid32bit:true|false] [lazycounter:true|false] [label:..] [uuid:..]
    ...
    Beginning with XFS version 5, it is no longer possible to modify the lazy-counters setting (ie. "lazycounter" parameter has no effect).  ---new line added

Comment 11 YongkuiGuo 2021-11-24 11:06:11 UTC
rjones, is there possible to fix this issue on RHEL8.6? If yes, please help clone this bug.

Comment 12 Richard W.M. Jones 2021-11-24 11:28:11 UTC
(In reply to YongkuiGuo from comment #11)
> rjones, is there possible to fix this issue on RHEL8.6? If yes, please help
> clone this bug.

I think I'd prefer not to make fixes in RHEL 8.6 unless they are
very important.

Comment 13 YongkuiGuo 2021-11-24 11:32:37 UTC
(In reply to Richard W.M. Jones from comment #12)
> (In reply to YongkuiGuo from comment #11)
> > rjones, is there possible to fix this issue on RHEL8.6? If yes, please help
> > clone this bug.
> 
> I think I'd prefer not to make fixes in RHEL 8.6 unless they are
> very important.

Make sense. Thanks.

Comment 15 errata-xmlrpc 2022-05-17 12:28:37 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 (new packages: libguestfs), 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:2317