From: Jaroslav Barton <jbarton@redhat.com>
To: xfs@oss.sgi.com
Cc: Jaroslav Barton <jbarton@redhat.com>
Subject: [PATCH] _check_generic_filesistem support for fsck parameters
Date: Wed, 16 Sep 2009 08:24:05 +0200 [thread overview]
Message-ID: <1253082245-5333-1-git-send-email-jbarton@redhat.com> (raw)
In-Reply-To: <20090915124908.GA4070@infradead.org>
_check_generic_filesystem now support fsck parameters. Fsck parameters
can be passed by FSCK_OPTIONS environmental variable. Default values
will be used if FSCK_OPTIONS is missing or empty (same mechanism as
MOUNT_OPTIONS and MKFS_OPTIONS).
_check_extN_filesystem function is no longer needed, extN filesystem are
properly handled by default values in _check_generic_filesystem.
---
common.rc | 70 ++++++++++++++----------------------------------------------
1 files changed, 17 insertions(+), 53 deletions(-)
diff --git a/common.rc b/common.rc
index da5f99e..761170d 100644
--- a/common.rc
+++ b/common.rc
@@ -91,9 +91,25 @@ _mkfs_opts()
esac
}
+_fsck_opts()
+{
+ case $FSTYP in
+ ext2|ext3|ext4)
+ export FSCK_OPTIONS="-nf"
+ ;;
+ reiserfs)
+ export FSCK_OPTIONS="--yes"
+ ;;
+ *)
+ export FSCK_OPTIONS="-n"
+ ;;
+ esac
+}
+
[ -z "$FSTYP" ] && FSTYP=xfs
[ -z "$MOUNT_OPTIONS" ] && _mount_opts
[ -z "$MKFS_OPTIONS" ] && _mkfs_opts
+[ -z "$FSCK_OPTIONS" ] && _fsck_opts
# we need common.config
@@ -835,7 +851,7 @@ _check_generic_filesystem()
mountpoint=`_umount_or_remount_ro $device`
fi
- fsck -t $FSTYP -n $device >$tmp.fsck 2>&1
+ fsck -t $FSTYP $FSCK_OPTIONS $device >$tmp.fsck 2>&1
if [ $? -ne 0 ]
then
echo "_check_generic_filesystem: filesystem on $device is inconsistent (see $seq.full)"
@@ -865,52 +881,6 @@ _check_generic_filesystem()
return 0
}
-# Check an ext2/3/4 filesystem
-#
-_check_extN_filesystem()
-{
- device=$1
-
- # If type is set, we're mounted
- type=`_fs_type $device`
- ok=1
-
- if [ "$type" = "$FSTYP" ]
- then
- # mounted ...
- mountpoint=`_umount_or_remount_ro $device`
- fi
-
- e2fsck -nf $device >$tmp.fsck 2>&1
- if [ $? -ne 0 ]
- then
- echo "_check_extN_filesystem: filesystem on $device is inconsistent (see $seq.full)"
-
- echo "_check_extN filesystem: filesystem on $device is inconsistent" >>$here/$seq.full
- echo "*** e2fsck output ***" >>$here/$seq.full
- cat $tmp.fsck >>$here/$seq.full
- echo "*** end e2fsck output" >>$here/$seq.full
-
- ok=0
- fi
- rm -f $tmp.fsck
-
- if [ $ok -eq 0 ]
- then
- echo "*** mount output ***" >>$here/$seq.full
- _mount >>$here/$seq.full
- echo "*** end mount output" >>$here/$seq.full
- elif [ "$type" = "$FSTYP" ]
- then
- # was mounted ...
- _mount_or_remount_rw "$MOUNT_OPTIONS" $device $mountpoint
- ok=$?
- fi
-
- [ $ok -eq 0 ] && exit 1
- return 0
-}
-
# run xfs_check and friends on a FS.
_check_xfs_filesystem()
@@ -1079,9 +1049,6 @@ _check_test_fs()
udf)
# do nothing for now
;;
- ext2|ext3|ext4)
- _check_extN_filesystem $TEST_DEV
- ;;
*)
_check_generic_filesystem $TEST_DEV
;;
@@ -1108,9 +1075,6 @@ _check_scratch_fs()
nfs*)
# Don't know how to check an NFS filesystem, yet.
;;
- ext2|ext3|ext4)
- _check_extN_filesystem $SCRATCH_DEV
- ;;
*)
_check_generic_filesystem $SCRATCH_DEV
;;
--
1.6.2.5
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2009-09-16 6:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-14 6:46 [xfstests]: add-reiserfs-specific-_check_reiserfs_filesystem patch Jaroslav Barton
2009-09-15 12:49 ` Christoph Hellwig
2009-09-16 6:24 ` Jaroslav Barton [this message]
2009-09-16 12:57 ` [PATCH] _check_generic_filesistem support for fsck parameters Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1253082245-5333-1-git-send-email-jbarton@redhat.com \
--to=jbarton@redhat.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox