* [PATCH] Add ext2/3/4-specific _check_extN_filesystem function
@ 2009-08-18 14:57 Theodore Ts'o
2009-08-18 16:11 ` Christoph Hellwig
0 siblings, 1 reply; 6+ messages in thread
From: Theodore Ts'o @ 2009-08-18 14:57 UTC (permalink / raw)
To: xfs; +Cc: Theodore Ts'o
The _check_generic_filesystem function doesn't force a full filesystem
check, so filesystem inconsistencies after a test wouldn't be noticed.
To fix this, I added an extN specific check filesystem function.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
common.rc | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 52 insertions(+), 0 deletions(-)
diff --git a/common.rc b/common.rc
index 82b0d51..da5f99e 100644
--- a/common.rc
+++ b/common.rc
@@ -865,6 +865,52 @@ _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()
@@ -1033,6 +1079,9 @@ _check_test_fs()
udf)
# do nothing for now
;;
+ ext2|ext3|ext4)
+ _check_extN_filesystem $TEST_DEV
+ ;;
*)
_check_generic_filesystem $TEST_DEV
;;
@@ -1059,6 +1108,9 @@ _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.3.2.1.gb9f7d.dirty
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] Add ext2/3/4-specific _check_extN_filesystem function
2009-08-18 14:57 [PATCH] Add ext2/3/4-specific _check_extN_filesystem function Theodore Ts'o
@ 2009-08-18 16:11 ` Christoph Hellwig
2009-08-18 17:04 ` Theodore Tso
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2009-08-18 16:11 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: xfs
On Tue, Aug 18, 2009 at 10:57:47AM -0400, Theodore Ts'o wrote:
> The _check_generic_filesystem function doesn't force a full filesystem
> check, so filesystem inconsistencies after a test wouldn't be noticed.
> To fix this, I added an extN specific check filesystem function.
Looks like the only difference between the generic and the extN
check routine is the addition of -f to the fsck command line. What
about just introducing a _fsck_args similar to _mount_opts where
filesystems can set their additional required mount options?
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Add ext2/3/4-specific _check_extN_filesystem function
2009-08-18 16:11 ` Christoph Hellwig
@ 2009-08-18 17:04 ` Theodore Tso
2009-08-26 22:12 ` Christoph Hellwig
0 siblings, 1 reply; 6+ messages in thread
From: Theodore Tso @ 2009-08-18 17:04 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
On Tue, Aug 18, 2009 at 12:11:16PM -0400, Christoph Hellwig wrote:
> On Tue, Aug 18, 2009 at 10:57:47AM -0400, Theodore Ts'o wrote:
> > The _check_generic_filesystem function doesn't force a full filesystem
> > check, so filesystem inconsistencies after a test wouldn't be noticed.
> > To fix this, I added an extN specific check filesystem function.
>
> Looks like the only difference between the generic and the extN
> check routine is the addition of -f to the fsck command line. What
> about just introducing a _fsck_args similar to _mount_opts where
> filesystems can set their additional required mount options?
That would work, yeah, and would be result in far less code
duplication in common.rc. I'll take a whack at it and resubmit.
Thanks,
- Ted
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Add ext2/3/4-specific _check_extN_filesystem function
2009-08-18 17:04 ` Theodore Tso
@ 2009-08-26 22:12 ` Christoph Hellwig
2009-08-27 2:05 ` Theodore Tso
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2009-08-26 22:12 UTC (permalink / raw)
To: Theodore Tso; +Cc: Christoph Hellwig, xfs
On Tue, Aug 18, 2009 at 01:04:56PM -0400, Theodore Tso wrote:
> > Looks like the only difference between the generic and the extN
> > check routine is the addition of -f to the fsck command line. What
> > about just introducing a _fsck_args similar to _mount_opts where
> > filesystems can set their additional required mount options?
>
> That would work, yeah, and would be result in far less code
> duplication in common.rc. I'll take a whack at it and resubmit.
Are you still going to look at it realtively soon? If not I'll just
put this version in to imrove the test coverage on extN and we can
clean it up later.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Add ext2/3/4-specific _check_extN_filesystem function
2009-08-26 22:12 ` Christoph Hellwig
@ 2009-08-27 2:05 ` Theodore Tso
2009-08-27 21:18 ` Christoph Hellwig
0 siblings, 1 reply; 6+ messages in thread
From: Theodore Tso @ 2009-08-27 2:05 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
On Wed, Aug 26, 2009 at 06:12:01PM -0400, Christoph Hellwig wrote:
> On Tue, Aug 18, 2009 at 01:04:56PM -0400, Theodore Tso wrote:
> > > Looks like the only difference between the generic and the extN
> > > check routine is the addition of -f to the fsck command line. What
> > > about just introducing a _fsck_args similar to _mount_opts where
> > > filesystems can set their additional required mount options?
> >
> > That would work, yeah, and would be result in far less code
> > duplication in common.rc. I'll take a whack at it and resubmit.
>
> Are you still going to look at it realtively soon? If not I'll just
> put this version in to imrove the test coverage on extN and we can
> clean it up later.
>
Sorry, work has gotten busy and I'm trying to get some last patches
whipped into shape before the merge window opens. I probably won't
have time to look at this for at least a week or two. So if you want
to merge this version in for now, I'll try to clean it up when I have
a chance.
- Ted
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] Add ext2/3/4-specific _check_extN_filesystem function
2009-08-27 2:05 ` Theodore Tso
@ 2009-08-27 21:18 ` Christoph Hellwig
0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2009-08-27 21:18 UTC (permalink / raw)
To: Theodore Tso; +Cc: xfs
On Wed, Aug 26, 2009 at 10:05:33PM -0400, Theodore Tso wrote:
> Sorry, work has gotten busy and I'm trying to get some last patches
> whipped into shape before the merge window opens. I probably won't
> have time to look at this for at least a week or two. So if you want
> to merge this version in for now, I'll try to clean it up when I have
> a chance.
Ok, I've put it in now.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-08-27 21:18 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-18 14:57 [PATCH] Add ext2/3/4-specific _check_extN_filesystem function Theodore Ts'o
2009-08-18 16:11 ` Christoph Hellwig
2009-08-18 17:04 ` Theodore Tso
2009-08-26 22:12 ` Christoph Hellwig
2009-08-27 2:05 ` Theodore Tso
2009-08-27 21:18 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox