Bug 1186515
| Summary: | GFS2: fsck.gfs2 fixes good directory goal value | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Nate Straz <nstraz> | |
| Component: | gfs2-utils | Assignee: | Abhijith Das <adas> | |
| Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> | |
| Severity: | unspecified | Docs Contact: | ||
| Priority: | high | |||
| Version: | 7.1 | CC: | adas, cluster-maint, gfs2-maint, sbradley, swhiteho | |
| Target Milestone: | rc | |||
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | gfs2-utils-3.1.8-2.el7 | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1201786 1238754 (view as bug list) | Environment: | ||
| Last Closed: | 2015-11-19 03:53:31 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: | ||||
| Bug Depends On: | 1184482 | |||
| Bug Blocks: | 1201786, 1205796, 1238754 | |||
| Attachments: | ||||
|
Description
Nate Straz
2015-01-27 20:32:52 UTC
fsck.gfs2 doesn't traverse the metadata tree for dirs in pass1 to be able to get at the last allocated block for it and attempts to set it to the inode block itself when it finds the i_goal value to be outside of the current rgrp. This is not desirable and fsck.gfs2 should probably leave directories alone. Nate also reported that gfs2_convert isn't making an attempt to fix goal values either and results in zeros being set instead. The fix for that needs to be rolled in along with this bug's patch. Created attachment 989919 [details]
make check_i_goal skip dirs whose goal blocks are not zero
This is an easy fix where fsck.gfs2 doesn't attempt to fix non-zero goal values for directories.
Created attachment 989920 [details]
another patch that attempts to do more of the right thing
This version deems an existing goal block as valid if it exists in any rgrp in the fs. It does this by checking the inode's goal block against all the rgrps in the fs. While the code tries to avoid checking all the rgrps as much as possible, if it does end up doing this often, then this becomes a very expensive operation.
The patch does the following:
1. If the computed goal_blk for a given inode is equal to the dinode's block, then we haven't really computed much and this is a worst-case correct value for the goal.
2. If we don't have a better computed goal (i.e 1. is true), we check if the existing goal block is valid using check_valid_block()
3. check_valid_block() tries to avoid running through all the rgrps by checking the following things first:
a) If the block is out of bounds of the filesystem, it's invalid.
b) If the block belongs to the same rgrp as that of the dinode, it is valid.
c) Warn the user that further investigation might take time and get her consent before finally resorting to check all the rgrps for this block.
d) If the block is found, we assume it is valid... invalid otherwise.
Created attachment 990481 [details]
make check_i_goal skip dirs whose goal blocks are out of fs bounds
This is a slight improvement over the first patch where check_i_goal assumes a block that falls within the fs bounds is valid for a directory's allocation goal block and skips such directories.
Some issues were discovered during testing of randomly allocated inodes where the kernel and fsck.gfs2 disagree on what their goal blocks should be. The conclusion at this point is that fsck.gfs2 is neither able to compute the goal block accurately nor verify if a given block is definitely the goal block of an inode. So, we revert the previous patches that attempted to compute the i_goal and fall back to a simpler logic where we set the i_goal of an inode to the inode metadata block if we find that the existing value is definitely wrong (i.e out of bounds of the fs). https://git.fedorahosted.org/cgit/gfs2-utils.git/commit/ is the upstream patch and the RHEL7 version has been pushed too. Verified with gfs2-utils-3.1.8-4.el7.x86_64 After running d_io on a file system, fsck.gfs2 no longer complains about directory i_goal values. [root@host-025 3.post]# cat 4.fsck/cmd.log Initializing fsck Validating Resource Group index. Level 1 rgrp check: Checking if all rgrp and rindex values are good. (level 1 passed) Starting pass1 pass1 completed in 0.168s Starting pass1b pass1b completed in 0.000s Starting pass1c pass1c completed in 0.001s Starting pass2 pass2 completed in 0.047s Starting pass3 pass3 completed in 0.000s Starting pass4 pass4 completed in 0.000s Starting pass5 pass5 completed in 0.027s Starting check_statfs check_statfs completed in 0.000s gfs2_fsck complete 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 |