From 5db9372a1313ef08c9c38bbff74c57acd3d21d28 Mon Sep 17 00:00:00 2001 From: Lachlan McIlroy Date: Thu, 30 Aug 2007 16:09:49 +0000 Subject: [PATCH] Report errors for missing files and check for correct file sizes Merge of master-melb:xfs-cmds:29557a by kenmcd. Report errors for missing files and check for correct file sizes --- 179 | 10 ++++++---- 180 | 12 +++++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/179 b/179 index b0bd1816..3a285ece 100644 --- a/179 +++ b/179 @@ -44,11 +44,11 @@ _check_files() while [ $i -lt 1000 ] do file=$SCRATCH_MNT/$i - # if file does not exist, the create was not logged, skip it + # if file is missing then fsync failed if [ -e $file ] then - # if file size is zero then fsync failed - if [ -s $file ] + # if file size is not 32k then fsync failed + if [ `stat -c %s $file` -eq 32768 ] then # if file has non-zero size but no extents then it's contents will be NULLs, bad. if xfs_bmap $file | grep 'no extents' > /dev/null @@ -58,8 +58,10 @@ _check_files() rm -f $file fi else - echo file $file has zero size - sync failed + echo file $file has incorrect size - fsync failed fi + else + echo file $file missing - fsync failed fi i=`expr $i + 1` done diff --git a/180 b/180 index c95962ef..e81d42fd 100644 --- a/180 +++ b/180 @@ -1,5 +1,5 @@ #! /bin/sh -# FSQA Test No. 179 +# FSQA Test No. 180 # # Test for NULL files problem # test inode size is on disk after sync @@ -44,11 +44,11 @@ _check_files() while [ $i -lt 1000 ] do file=$SCRATCH_MNT/$i - # if file does not exist, the create was not logged, skip it + # if file is missing then sync failed if [ -e $file ] then - # if file size is zero then fsync failed - if [ -s $file ] + # if file size is not 32k then sync failed + if [ `stat -c %s $file` -eq 32768 ] then # if file has non-zero size but no extents then it's contents will be NULLs, bad. if xfs_bmap $file | grep 'no extents' > /dev/null @@ -58,8 +58,10 @@ _check_files() rm -f $file fi else - echo file $file has zero size - sync failed + echo file $file has incorrect size - sync failed fi + else + echo file $file missing - sync failed fi i=`expr $i + 1` done -- 2.30.2