Bug 1670153
| Summary: | xfs_repair may rebuild free inode btree with wrong magic number in some nodes | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Eric Sandeen <esandeen> | |
| Component: | xfsprogs | Assignee: | Eric Sandeen <esandeen> | |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Zorro Lang <zlang> | |
| Severity: | urgent | Docs Contact: | ||
| Priority: | urgent | |||
| Version: | 8.0 | CC: | bfoster, dchinner, jwboyer, xzhou | |
| Target Milestone: | rc | Flags: | rule-engine:
mirror+
|
|
| Target Release: | 8.0 | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | ||
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1670154 (view as bug list) | Environment: | ||
| Last Closed: | 2019-06-14 01:31:11 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: | ||||
| Bug Blocks: | 1670154 | |||
|
Description
Eric Sandeen
2019-01-28 18:00:49 UTC
Asking for exception on this one - this is a late-discovered issue with the xfs_repair code which has a strong liklihood of corrupting on-disk metadata under certain circumstances. Hi Eric, Besides the xfsprogs fix, will merge kernel part improvement patches in RHEL-8.0? [PATCH RFC v2 0/3] xfs: fix [f]inobt magic value verification Thanks, Zorro We don't know yet, that's still RFC. Built in xfsprogs-4.19.0-2.el8 Reproduce this bug on xfsprogs-4.19.0-1.el8:
# rpm -q xfsprogs
xfsprogs-4.19.0-1.el8.x86_64
# mkfs.xfs -f -m finobt=1 $dev
# mount $dev $mnt
# mkdir $mnt/dir
# pushd $mnt/dir
# seq -w 0 20000000| xargs touch; sync; echo "create files done"; seq -w 0 32 20000000 | xargs rm
# xfs_db -r -c "agi 0" -c "p" $dev (make sure free_level >= 3)
magicnum = 0x58414749
versionnum = 1
seqno = 0
length = 8192000
count = 14737984
root = 1090814
level = 3
freecount = 460569
newino = 15775168
dirino = null
unlinked[0-63] =
uuid = e808acb6-361b-4d39-b4f5-40de81b43608
crc = 0x88a9ce1b (correct)
lsn = 0x1b00064dc1
free_root = 1972411
free_level = 3
# umount $dev
# xfs_repair $dev (old xfs_repair will break all level blocks after the leftmost block)
# xfs_repair -n $dev (reproduced)
Phase 1 - find and verify superblock...
- reporting progress in intervals of 15 minutes
Phase 2 - using internal log
- zero log...
- scan filesystem freespace and inode maps...
bad magic # 0x49414233 in inobt block 0/1972356
- 04:12:54: scanning filesystem freespace - 16 of 16 allocation groups done
- found root inode chunk
Phase 3 - for each AG...
- scan (but don't clear) agi unlinked lists...
- 04:12:54: scanning agi unlinked lists - 16 of 16 allocation groups done
- process known inodes and perform inode discovery...
- agno = 0
- agno = 15
- agno = 1
- agno = 2
- agno = 3
- agno = 4
- agno = 5
- agno = 6
- agno = 7
- agno = 8
- agno = 9
- agno = 10
- agno = 11
- agno = 12
- agno = 13
- agno = 14
- 04:14:18: process known inodes and inode discovery - 14737984 of 14737984 inodes done
- process newly discovered inodes...
- 04:14:18: process newly discovered inodes - 16 of 16 allocation groups done
Phase 4 - check for duplicate blocks...
- setting up duplicate extent list...
- 04:14:18: setting up duplicate extent list - 16 of 16 allocation groups done
- check for inodes claiming duplicate blocks...
- agno = 0
- agno = 2
- agno = 3
- agno = 5
- agno = 6
- agno = 7
- agno = 8
- agno = 9
- agno = 10
- agno = 11
- agno = 13
- agno = 4
- agno = 1
- agno = 15
- agno = 12
- agno = 14
- 04:14:51: check for inodes claiming duplicate blocks - 14737984 of 14737984 inodes done
No modify flag set, skipping phase 5
Inode allocation btrees are too corrupted, skipping phases 6 and 7
No modify flag set, skipping filesystem flush and exiting.
(In reply to Zorro Lang from comment #10) > Reproduce this bug on xfsprogs-4.19.0-1.el8: > # rpm -q xfsprogs > xfsprogs-4.19.0-1.el8.x86_64 > # mkfs.xfs -f -m finobt=1 $dev > # mount $dev $mnt > # mkdir $mnt/dir > # pushd $mnt/dir > # seq -w 0 20000000| xargs touch; sync; echo "create files done"; seq -w 0 > 32 20000000 | xargs rm > # xfs_db -r -c "agi 0" -c "p" $dev (make sure free_level >= 3) > magicnum = 0x58414749 > versionnum = 1 > seqno = 0 > length = 8192000 > count = 14737984 > root = 1090814 > level = 3 > freecount = 460569 > newino = 15775168 > dirino = null > unlinked[0-63] = > uuid = e808acb6-361b-4d39-b4f5-40de81b43608 > crc = 0x88a9ce1b (correct) > lsn = 0x1b00064dc1 > free_root = 1972411 > free_level = 3 > # umount $dev > # xfs_repair $dev (old xfs_repair will break all level blocks after the > leftmost block) > # xfs_repair -n $dev (reproduced) > Phase 1 - find and verify superblock... > - reporting progress in intervals of 15 minutes > Phase 2 - using internal log > - zero log... > - scan filesystem freespace and inode maps... > bad magic # 0x49414233 in inobt block 0/1972356 > - 04:12:54: scanning filesystem freespace - 16 of 16 allocation > groups done > - found root inode chunk > Phase 3 - for each AG... > - scan (but don't clear) agi unlinked lists... > - 04:12:54: scanning agi unlinked lists - 16 of 16 allocation groups > done > - process known inodes and perform inode discovery... > - agno = 0 > - agno = 15 > - agno = 1 > - agno = 2 > - agno = 3 > - agno = 4 > - agno = 5 > - agno = 6 > - agno = 7 > - agno = 8 > - agno = 9 > - agno = 10 > - agno = 11 > - agno = 12 > - agno = 13 > - agno = 14 > - 04:14:18: process known inodes and inode discovery - 14737984 of > 14737984 inodes done > - process newly discovered inodes... > - 04:14:18: process newly discovered inodes - 16 of 16 allocation > groups done > Phase 4 - check for duplicate blocks... > - setting up duplicate extent list... > - 04:14:18: setting up duplicate extent list - 16 of 16 allocation > groups done > - check for inodes claiming duplicate blocks... > - agno = 0 > - agno = 2 > - agno = 3 > - agno = 5 > - agno = 6 > - agno = 7 > - agno = 8 > - agno = 9 > - agno = 10 > - agno = 11 > - agno = 13 > - agno = 4 > - agno = 1 > - agno = 15 > - agno = 12 > - agno = 14 > - 04:14:51: check for inodes claiming duplicate blocks - 14737984 of > 14737984 inodes done > No modify flag set, skipping phase 5 > Inode allocation btrees are too corrupted, skipping phases 6 and 7 > No modify flag set, skipping filesystem flush and exiting. Can't reproduce this bug on xfsprogs-4.19.0-2.el8 # rpm -q xfsprogs xfsprogs-4.19.0-2.el8.x86_64 # xfs_repair $dev # xfs_repair -n $dev Phase 1 - find and verify superblock... - reporting progress in intervals of 15 minutes Phase 2 - using internal log - zero log... - scan filesystem freespace and inode maps... - 04:45:56: scanning filesystem freespace - 16 of 16 allocation groups done - found root inode chunk Phase 3 - for each AG... - scan (but don't clear) agi unlinked lists... - 04:45:56: scanning agi unlinked lists - 16 of 16 allocation groups done - process known inodes and perform inode discovery... - agno = 15 - agno = 0 - agno = 1 - agno = 2 - agno = 3 - agno = 4 - agno = 5 - agno = 6 - agno = 7 - agno = 8 - agno = 9 - agno = 10 - agno = 11 - agno = 12 - agno = 13 - agno = 14 - 04:47:27: process known inodes and inode discovery - 14737984 of 14737984 inodes done - process newly discovered inodes... - 04:47:27: process newly discovered inodes - 16 of 16 allocation groups done Phase 4 - check for duplicate blocks... - setting up duplicate extent list... - 04:47:27: setting up duplicate extent list - 16 of 16 allocation groups done - check for inodes claiming duplicate blocks... - agno = 0 - agno = 11 - agno = 3 - agno = 4 - agno = 5 - agno = 7 - agno = 8 - agno = 12 - agno = 10 - agno = 6 - agno = 9 - agno = 15 - agno = 2 - agno = 13 - agno = 14 - agno = 1 - 04:47:58: check for inodes claiming duplicate blocks - 14737984 of 14737984 inodes done No modify flag set, skipping phase 5 Phase 6 - check inode connectivity... - traversing filesystem ... - traversal finished ... - moving disconnected inodes to lost+found ... Phase 7 - verify link counts... - 04:54:16: verify and correct link counts - 16 of 16 allocation groups done No modify flag set, skipping filesystem flush and exiting. # echo $? 0 |