public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [xfstests]: add-reiserfs-specific-_check_reiserfs_filesystem patch
@ 2009-09-14  6:46 Jaroslav Barton
  2009-09-15 12:49 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Jaroslav Barton @ 2009-09-14  6:46 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: Type: text/plain, Size: 249 bytes --]

Hi,

I was on vacation last week.

I am using xfstests in my project and testing reiserfs filesystem. Reiserfsck 
waits for confirmation before fsck is runned. This patch runs reiserfsck with 
--yes parameter and confirmation is not needed.

Thanks

[-- Attachment #2: 0001-add-reiserfs-specific-_check_reiserfs_filesystem-fun.patch --]
[-- Type: text/x-patch, Size: 2417 bytes --]

From f34d69cbbcdde9fa973e8c3ddb7fa3e9b17c7305 Mon Sep 17 00:00:00 2001
From: Jaroslav Barton <jbarton@redhat.com>
Date: Fri, 4 Sep 2009 11:09:32 +0200
Subject: [PATCH] add reiserfs specific _check_reiserfs_filesystem function

The _check_generic_filesystem function doesn't start reiserfsck
correctly. Reiserfsck waits for user answer (user must write Yes,
but question is not visible). This specific function runs
reiserfsck with --yes parameter to awoid waiting for answer.
---
 common.rc |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/common.rc b/common.rc
index da5f99e..8b990ba 100644
--- a/common.rc
+++ b/common.rc
@@ -911,6 +911,50 @@ _check_extN_filesystem()
     return 0
 }
 
+_check_reiserfs_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
+	
+	reiserfsck --yes $device >$tmp.fsck 2>&1
+    if [ $? -ne 0 ]
+    then
+        echo "_check_reiserfs_filesystem: filesystem on $device is inconsistent (see $seq.full)"
+
+        echo "_check_reiserfs_filesystem: filesystem on $device is inconsistent" >>$here/$seq.full
+        echo "*** reiserfsck output ***"                          >>$here/$seq.full
+        cat $tmp.fsck                                         >>$here/$seq.full
+        echo "*** end reiserfsck 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()
@@ -1082,6 +1126,9 @@ _check_test_fs()
     ext2|ext3|ext4)
 	_check_extN_filesystem $TEST_DEV
 	;;
+	reiserfs)
+	_check_reiserfs_filesystem $TEST_DEV
+	;;
     *)
 	_check_generic_filesystem $TEST_DEV
 	;;
-- 
1.6.2.5


[-- Attachment #3: Type: text/plain, Size: 121 bytes --]

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [xfstests]: add-reiserfs-specific-_check_reiserfs_filesystem patch
  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   ` [PATCH] _check_generic_filesistem support for fsck parameters Jaroslav Barton
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2009-09-15 12:49 UTC (permalink / raw)
  To: Jaroslav Barton; +Cc: xfs

On Mon, Sep 14, 2009 at 08:46:52AM +0200, Jaroslav Barton wrote:
> Hi,
> 
> I was on vacation last week.
> 
> I am using xfstests in my project and testing reiserfs filesystem. Reiserfsck 
> waits for confirmation before fsck is runned. This patch runs reiserfsck with 
> --yes parameter and confirmation is not needed.

I'd be much more happy if you would add a way to pass options to
_check_generic_filesystem, e.g. by introducing a _fsck_opts machinery
mirroring _mkfs_opts and _mount_opts.  That would also clean up what
Ted did in 8b61ae6352b1f92cc004a7349b90f39609c77a8f.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] _check_generic_filesistem support for fsck parameters
  2009-09-15 12:49 ` Christoph Hellwig
@ 2009-09-16  6:24   ` Jaroslav Barton
  2009-09-16 12:57     ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Jaroslav Barton @ 2009-09-16  6:24 UTC (permalink / raw)
  To: xfs; +Cc: Jaroslav Barton

_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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] _check_generic_filesistem support for fsck parameters
  2009-09-16  6:24   ` [PATCH] _check_generic_filesistem support for fsck parameters Jaroslav Barton
@ 2009-09-16 12:57     ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2009-09-16 12:57 UTC (permalink / raw)
  To: Jaroslav Barton; +Cc: xfs

On Wed, Sep 16, 2009 at 08:24:05AM +0200, Jaroslav Barton wrote:
> _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.

Thanks, I've put this in.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-09-16 12:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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   ` [PATCH] _check_generic_filesistem support for fsck parameters Jaroslav Barton
2009-09-16 12:57     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox