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.
The pairs are due to these two paths, both originating in the pass2() function:
#2 0x000000000040cb83 in fsck_load_inode (sdp=0x7fffffffdc10, block=229964) at metawalk.c:244
#3 0x00000000004107e9 in check_dir (sdp=0x7fffffffdc10, block=229964, pass=0x649800 <pass2_fxns>) at metawalk.c:1706
#4 0x000000000041e478 in pass2 (sdp=0x7fffffffdc10) at pass2.c:1907
and shortly after:
#2 0x000000000040cb83 in fsck_load_inode (sdp=0x7fffffffdc10, block=229964) at metawalk.c:244
#3 0x000000000041e717 in pass2 (sdp=0x7fffffffdc10) at pass2.c:1956
The inode is thrown away before check_dir() returns, which is why the second fsck_load_inode() is happening. I'll look into changing check_dir() to accept an inode instead of loading it, and load it earlier in pass2().
Created attachment 997988[details]
Patch posted upstream
This patch removes the duplicate read and adds failure checking for the remaining one. Note that, as the inode block is cached when the second read happens, this patch doesn't give a noticeable performance increase, although reducing the duplication is worthwhile.
Verified with gfs2-utils-3.1.8-4.el7.x86_64
I created a file system w/ 500k files and ran fsck.gfs2 on it. After removing everything from the log besides pass2 I found no duplicate inode reads.
[root@host-050 sts-rhel7.2]# grep preadv /tmp/fsck-strace.log | grep '\\1\\26\\31p\\0\\0\\0\\4'
preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\0\0\0\0\0\0\0\0\5"..., 4096}], 1, 134598656) = 4096
preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\0\0\0\0\0\0\0\0\6"..., 4096}], 1, 134602752) = 4096
preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\0\0\0\0\0\0\0\0\7"..., 4096}], 1, 134606848) = 4096
preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\0\0\0\0\0\0\0\0\1"..., 4096}], 1, 3531337728) = 4096
preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\0\0\0\0\0\0\0\0\1"..., 4096}], 1, 4576481280) = 4096
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-2015-2178.html
Description of problem: While waiting for a 100TB file system fsck I pulled some strace samples during pass2 and found that inodes were being read twice, consecutively. preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\4\0\0\0\0\0\0\10m"..., 4096}], 1, 100874726567936) = 4096 preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\4\0\0\0\0\0\0\10m"..., 4096}], 1, 100874726567936) = 4096 preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\4\0\0\0\0\0\0\10o"..., 4096}], 1, 100874726666240) = 4096 preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\4\0\0\0\0\0\0\10o"..., 4096}], 1, 100874726666240) = 4096 preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\4\0\0\0\0\0\0\10q"..., 4096}], 1, 100874726785024) = 4096 preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\4\0\0\0\0\0\0\10q"..., 4096}], 1, 100874726785024) = 4096 preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\4\0\0\0\0\0\0\10s"..., 4096}], 1, 100874726924288) = 4096 preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\4\0\0\0\0\0\0\10s"..., 4096}], 1, 100874726924288) = 4096 preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\4\0\0\0\0\0\0\10u"..., 4096}], 1, 100874727014400) = 4096 preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\4\0\0\0\0\0\0\10u"..., 4096}], 1, 100874727014400) = 4096 preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\4\0\0\0\0\0\0\10w"..., 4096}], 1, 100874727170048) = 4096 preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\4\0\0\0\0\0\0\10w"..., 4096}], 1, 100874727170048) = 4096 preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\4\0\0\0\0\0\0\10y"..., 4096}], 1, 100874727473152) = 4096 preadv(4, [{"\1\26\31p\0\0\0\4\0\0\0\0\0\0\0\0\0\0\1\220\0\0\0\4\0\0\0\0\0\0\10y"..., 4096}], 1, 100874727473152) = 4096 Version-Release number of selected component (if applicable): gfs2-utils-3.1.7-1.el7.x86_64 How reproducible: Easily Steps to Reproduce: 1. Create a lot of files on a GFS2 file system 2. Run fsck.gfs2 Actual results: Expected results: Additional info: