From b4b13ee325c2d5f194258446688100607b09c5cd Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Mon, 4 Jun 2007 06:12:42 +0000 Subject: [PATCH] Make sure the repair tests dirty the filesystem before corrupting it. Merge of master-melb:xfs-cmds:28770a by kenmcd. Make sure the repair tests dirty the filesystem before corrupting it. --- 030.out.irix | 4 ++++ 030.out.linux | 4 ++++ 148.out | 4 ++++ common.repair | 10 ++++++++++ 4 files changed, 22 insertions(+) diff --git a/030.out.irix b/030.out.irix index 54f8e06a..6378c73f 100644 --- a/030.out.irix +++ b/030.out.irix @@ -262,6 +262,10 @@ Wrote X.XXKb (value 0xffffffff) Phase 1 - find and verify superblock... Phase 2 - zero log... - scan filesystem freespace and inode maps... +bad agbno AGBNO in agfl, agno 0 +bad agbno AGBNO in agfl, agno 0 +bad agbno AGBNO in agfl, agno 0 +bad agbno AGBNO in agfl, agno 0 - found root inode chunk Phase 3 - for each AG... - scan and clear agi unlinked lists... diff --git a/030.out.linux b/030.out.linux index 48fdedd8..2b3dc544 100644 --- a/030.out.linux +++ b/030.out.linux @@ -270,6 +270,10 @@ Phase 1 - find and verify superblock... Phase 2 - using log - zero log... - scan filesystem freespace and inode maps... +bad agbno AGBNO in agfl, agno 0 +bad agbno AGBNO in agfl, agno 0 +bad agbno AGBNO in agfl, agno 0 +bad agbno AGBNO in agfl, agno 0 - found root inode chunk Phase 3 - for each AG... - scan and clear agi unlinked lists... diff --git a/148.out b/148.out index 117459cf..466a55da 100644 --- a/148.out +++ b/148.out @@ -270,6 +270,10 @@ Phase 1 - find and verify superblock... Phase 2 - using log - zero log... - scan filesystem freespace and inode maps... +bad agbno AGBNO in agfl, agno 0 +bad agbno AGBNO in agfl, agno 0 +bad agbno AGBNO in agfl, agno 0 +bad agbno AGBNO in agfl, agno 0 - found root inode chunk Phase 3 - for each AG... - scan and clear agi unlinked lists... diff --git a/common.repair b/common.repair index 8edbc45d..3f7353d1 100644 --- a/common.repair +++ b/common.repair @@ -72,8 +72,18 @@ _check_repair() { value=$1 structure="$2" + + #ensure the filesystem has been dirtied since last repair + _scratch_mount + POSIXLY_CORRECT=yes \ + dd if=/bin/sh of=$SCRATCH_MNT/sh 2>&1 |_filter_dd + sync + rm -f $SCRATCH_MNT/sh + umount $SCRATCH_MNT + _zero_position $value "$structure" _scratch_xfs_repair 2>&1 | _filter_repair + # some basic sanity checks... _check_scratch_fs _scratch_mount #mount -- 2.39.5