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 1350600 - fsck.gfs2: formal inode number regression #2 with small-memory version
Summary: fsck.gfs2: formal inode number regression #2 with small-memory version
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gfs2-utils
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Robert Peterson
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-27 20:18 UTC by Robert Peterson
Modified: 2016-11-04 06:31 UTC (History)
5 users (show)

Fixed In Version: gfs2-utils-3.1.9-2.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 06:31:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed RHEL7 patch (10.28 KB, patch)
2016-06-27 20:23 UTC, Robert Peterson
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2438 0 normal SHIPPED_LIVE gfs2-utils bug fix and enhancement update 2016-11-03 14:01:57 UTC

Description Robert Peterson 2016-06-27 20:18:11 UTC
Description of problem:
This is a regression introduced by commit f2ffb1e.
Before commit f2ffb1e, function basic_dentry_checks had access to a
complete inode tree, so it was able to check the formal inode number
of every dentry against what it previously found in the inode in
pass1. But commit f2ffb1e changed function basic_dentry_checks so
that it bypasses the check if the reference count is 1, which is
most likely, and it's going to be correct 99% of the time. The
comments state:

"Since we don't have ii or di, the only way to validate formal_ino
is to read in the inode, which would kill performance. So skip it
for now."

The problem is, problems can slip through, undetected, and will
only be fixed with a second run of fsck.gfs2. For example, during
testing, I found a set of gfs2 metadata that had two dentries
pointing to the same dinode. The first dentry encountered by pass2
was wrong, but it was not checked for this reason. The second
dentry was correct. The first run of fsck did not catch the problem
and reacted by setting link count to 2 for the dinode, keeping
both dentries. The second run found the problem and fixed it,
changing the link count back to 1 and deleting the bad dentry.

Note that this problem only applies to non-directories, since
directories will have a value in the dirtree to check against.

Version-Release number of selected component (if applicable):
RHEL7.3 pre-release

How reproducible:
Always

Steps to Reproduce:
1.Restore metadata set 00716231-LogVolUser1.150113.prefsck.902920.mda
  to a device
2.Run fsck.gfs2 -y
3.Run fsck.gfs2 without -y

Actual results:
The first run acts like it fixed all the problems.
The second run complains about a dinode with the wrong formal inode number.
The bad dentry, "goog-phish-shavar.sbstore" is deleted from the
directory.

Expected results:
The problem in goog-phish-shavar.sbstore should be found and
fixed on the first run. The second run should come up clean and
give a 0 return code.

Additional info:
I've got a working patch for this.

Comment 1 Robert Peterson 2016-06-27 20:23:03 UTC
Created attachment 1173161 [details]
Proposed RHEL7 patch

This patch fixes the problem.

Comment 2 Robert Peterson 2016-07-06 13:09:24 UTC
The upstream patch is now pushed here:
https://git.fedorahosted.org/cgit/gfs2-utils.git/commit/?id=ab92c41323babc6b6578cddfb4324ae545927f88

The RHEL7 patch is now pushed here:
https://git.fedorahosted.org/cgit/gfs2-utils.git/commit/?h=RHEL7&id=c78fedfd07a455e934b0a603c9c2e124b9522662

It was tested on system gfs-i24c-01.mpc.lab.eng.bos.redhat.com

Changing status to POST until it gets built into a new
gfs2-utils.

Comment 6 Justin Payne 2016-09-23 16:32:31 UTC
Verified in gfs2-utils-3.1.9-3.el7:

[root@south-16 ~]# rpm -q gfs2-utils
gfs2-utils-3.1.9-3.el7.x86_64
[root@south-16 ~]# gfs2_edit restoremeta 00716231-LogVolUser1.150113.prefsck.902920.mda /dev/sdb1
No valid file header found. Falling back to old format...
Block size is 4096B
This is gfs2 metadata.
There are 469649399 free blocks on the destination device.
Highest saved block is 65535869 (0x3e7ff7d)
65535870 blocks processed, 1416884 saved (100%)
File 00716231-LogVolUser1.150113.prefsck.902920.mda restore successful.
[root@south-16 ~]# fsck.gfs2 -y /dev/sdb1 &> /tmp/fsck.out 
[root@south-16 ~]# fsck.gfs2 /dev/sdb1
Initializing fsck
Validating resource group index.
Level 1 resource group check: Checking if all rgrp and rindex values are good.
(level 1 passed)
Starting pass1
Reconciling bitmaps.
reconcile_bitmaps completed in 1.117s
pass1 completed in 15m56.318s
Starting pass1b
pass1b completed in 0.000s
Starting pass2
pass2 completed in 1m9.512s
Starting pass3
pass3 completed in 0.025s
Starting pass4
pass4 completed in 0.327s
Starting check_statfs
check_statfs completed in 0.000s
gfs2_fsck complete

Comment 7 Robert Peterson 2016-10-31 12:24:19 UTC
Clearing the needinfo flag. I think we've answered all the questions
with regard to this bug. If there are outstanding questions, feel
free to set the flag again.

Comment 9 errata-xmlrpc 2016-11-04 06:31:23 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, 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://rhn.redhat.com/errata/RHBA-2016-2438.html


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