From: Nathan Scott Date: Wed, 9 Jun 2004 11:38:17 +0000 (+0000) Subject: xfs_check now looks to see if the log is dirty before running. X-Git-Tag: v2.7.0~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=add013da008836848333582b70dc6f432237e6d0;p=thirdparty%2Fxfsprogs-dev.git xfs_check now looks to see if the log is dirty before running. --- diff --git a/VERSION b/VERSION index 392fe8613..d822914ba 100644 --- a/VERSION +++ b/VERSION @@ -3,5 +3,5 @@ # PKG_MAJOR=2 PKG_MINOR=6 -PKG_REVISION=14 +PKG_REVISION=15 PKG_BUILD=1 diff --git a/db/check.c b/db/check.c index a84888718..ad09eb3e4 100644 --- a/db/check.c +++ b/db/check.c @@ -37,6 +37,7 @@ #include "check.h" #include "command.h" #include "io.h" +#include "sb.h" #include "output.h" #include "type.h" #include "init.h" @@ -1725,6 +1726,8 @@ init( mp->m_sb.sb_magicnum); return 0; } + if (!sb_logcheck()) + return 0; rt = mp->m_sb.sb_rextents != 0; dbmap = xmalloc((mp->m_sb.sb_agcount + rt) * sizeof(*dbmap)); inomap = xmalloc((mp->m_sb.sb_agcount + rt) * sizeof(*inomap)); diff --git a/db/sb.c b/db/sb.c index 67ec56051..8e5b81983 100644 --- a/db/sb.c +++ b/db/sb.c @@ -220,8 +220,8 @@ get_sb(xfs_agnumber_t agno, xfs_sb_t *sb) /* workaround craziness in the xlog routines */ int xlog_recover_do_trans(xlog_t *log, xlog_recover_t *t, int p) { return 0; } -static int -zero_log(uuid_t *uuidp) +int +sb_logcheck(void) { xlog_t log; xfs_daddr_t head_blk, tail_blk; @@ -265,10 +265,19 @@ zero_log(uuid_t *uuidp) "of the filesystem before doing this.\n", progname); return 0; } + return 1; +} + +static int +sb_logzero(uuid_t *uuidp) +{ + if (!sb_logcheck()) + return 0; dbprintf("Clearing log and setting UUID\n"); - if (libxfs_log_clear(log.l_dev, + if (libxfs_log_clear( + (mp->m_sb.sb_logstart == 0) ? x.logdev : x.ddev, XFS_FSB_TO_DADDR(mp, mp->m_sb.sb_logstart), (xfs_extlen_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks), uuidp, @@ -370,7 +379,7 @@ uuid_f( } /* clear the log (setting uuid) if its not dirty */ - if (!zero_log(&uu)) + if (!sb_logzero(&uu)) return 0; dbprintf("writing all SBs\n"); diff --git a/db/sb.h b/db/sb.h index 0ec544f39..013b32e7e 100644 --- a/db/sb.h +++ b/db/sb.h @@ -36,4 +36,5 @@ extern const struct field sb_flds[]; extern const struct field sb_hfld[]; extern void sb_init(void); +extern int sb_logcheck(void); extern int sb_size(void *obj, int startoff, int idx); diff --git a/db/xfs_check.sh b/db/xfs_check.sh index 7866cfb26..a0afcaffe 100755 --- a/db/xfs_check.sh +++ b/db/xfs_check.sh @@ -32,10 +32,10 @@ # OPTS=" " -ISFILE=" " -USAGE="Usage: xfs_check [-fsvV] [-i ino]... [-b bno]... special" +DBOPTS=" " +USAGE="Usage: xfs_check [-fsvV] [-l logdev] [-i ino]... [-b bno]... special" -while getopts "b:fi:stvV" c +while getopts "b:fi:l:stvV" c do case $c in s) OPTS=$OPTS"-s ";; @@ -44,7 +44,8 @@ do V) OPTS=$OPTS"-V ";; i) OPTS=$OPTS"-i "$OPTARG" ";; b) OPTS=$OPTS"-b "$OPTARG" ";; - f) ISFILE=" -f";; + f) DBOPTS=$DBOPTS" -f";; + l) DBOPTS=$DBOPTS" -l "$OPTARG" ";; \?) echo $USAGE 1>&2 exit 2 ;; @@ -53,7 +54,7 @@ done set -- extra $@ shift $OPTIND case $# in - 1) xfs_db$ISFILE -i -p xfs_check -c "check$OPTS" $1 + 1) xfs_db$DBOPTS -i -p xfs_check -c "check$OPTS" $1 status=$? ;; *) echo $USAGE 1>&2 diff --git a/db/xfs_check64.sh b/db/xfs_check64.sh index 5c6dcaaea..f28a83204 100755 --- a/db/xfs_check64.sh +++ b/db/xfs_check64.sh @@ -32,10 +32,10 @@ # OPTS=" " -ISFILE=" " -USAGE="Usage: xfs_check64 [-fsvV] [-i ino]... [-b bno]... special" +DBOPTS=" " +USAGE="Usage: xfs_check64 [-fsvV] [-l logdev] [-i ino]... [-b bno]... special" -while getopts "b:fi:stvV" c +while getopts "b:fi:l:stvV" c do case $c in s) OPTS=$OPTS"-s ";; @@ -44,7 +44,8 @@ do V) OPTS=$OPTS"-V ";; i) OPTS=$OPTS"-i "$OPTARG" ";; b) OPTS=$OPTS"-b "$OPTARG" ";; - f) ISFILE=" -f";; + f) DBOPTS=" -f";; + l) DBOPTS=$DBOPTS" -l "$OPTARG" ";; \?) echo $USAGE 1>&2 exit 2 ;; @@ -53,7 +54,7 @@ done set -- extra $@ shift $OPTIND case $# in - 1) xfs_db64$ISFILE -i -p xfs_check64 -c "check$OPTS" $1 + 1) xfs_db64$DBOPTS -i -p xfs_check64 -c "check$OPTS" $1 status=$? ;; *) echo $USAGE 1>&2 diff --git a/db/xfs_ncheck.sh b/db/xfs_ncheck.sh index 5ac5741ec..e6ebc126a 100755 --- a/db/xfs_ncheck.sh +++ b/db/xfs_ncheck.sh @@ -32,18 +32,19 @@ # OPTS=" " -ISFILE=" " -USAGE="usage: xfs_ncheck [-sfV] [-i ino]... special" +DBOPTS=" " +USAGE="usage: xfs_ncheck [-sfV] [-l logdev] [-i ino]... special" -while getopts "b:fi:svV" c +while getopts "b:fi:l:svV" c do case $c in s) OPTS=$OPTS"-s ";; i) OPTS=$OPTS"-i "$OPTARG" ";; v) OPTS=$OPTS"-v ";; V) OPTS=$OPTS"-V ";; - f) ISFILE=" -f";; + f) DBOPTS=$DBOPTS" -f";; + l) DBOPTS=$DBOPTS" -l "$OPTARG" ";; \?) echo $USAGE 1>&2 exit 2 ;; @@ -52,7 +53,7 @@ done set -- extra $@ shift $OPTIND case $# in - 1) xfs_db$ISFILE -r -p xfs_ncheck -c "blockget -ns" -c "ncheck$OPTS" $1 + 1) xfs_db$DBOPTS -r -p xfs_ncheck -c "blockget -ns" -c "ncheck$OPTS" $1 status=$? ;; *) echo $USAGE 1>&2 diff --git a/db/xfs_ncheck64.sh b/db/xfs_ncheck64.sh index 3fa4aafe5..a0f3dce5b 100755 --- a/db/xfs_ncheck64.sh +++ b/db/xfs_ncheck64.sh @@ -32,18 +32,18 @@ # OPTS=" " -ISFILE=" " -USAGE="usage: xfs_ncheck64 [-sfvV] [-i ino]... special" +DBOPTS=" " +USAGE="usage: xfs_ncheck64 [-sfvV] [-l logdev] [-i ino]... special" - -while getopts "b:fi:svV" c +while getopts "b:fi:l:svV" c do case $c in s) OPTS=$OPTS"-s ";; i) OPTS=$OPTS"-i "$OPTARG" ";; v) OPTS=$OPTS"-v ";; V) OPTS=$OPTS"-V ";; - f) ISFILE=" -f";; + f) DBOPTS=" -f";; + l) DBOPTS=$DBOPTS" -l "$OPTARG" ";; \?) echo $USAGE 1>&2 exit 2 ;; @@ -52,7 +52,7 @@ done set -- extra $@ shift $OPTIND case $# in - 1) xfs_db64$ISFILE -r -p xfs_ncheck64 -c "blockget -ns" -c "ncheck$OPTS" $1 + 1) xfs_db64$DBOPTS -r -p xfs_ncheck64 -c "blockget -ns" -c "ncheck$OPTS" $1 status=$? ;; *) echo $USAGE 1>&2 diff --git a/debian/changelog b/debian/changelog index 6deda9fc0..e37313014 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xfsprogs (2.6.15-1) unstable; urgency=low + + * New upstream release. + + -- Nathan Scott Wed, 09 Jun 2004 21:10:14 +1000 + xfsprogs (2.6.14-1) unstable; urgency=low * New upstream release. diff --git a/doc/CHANGES b/doc/CHANGES index 5fd5dea6d..841c2944b 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,3 +1,9 @@ +xfsprogs-2.6.15 (09 June 2004) + - Make xfs_check test for a dirty log before proceeding to + check the filesystem. + - Fix couple of minor bugs in xfs_io (readonly handling on + writes, off-by-one error in open file error reporting). + xfsprogs-2.6.14 (13 May 2004) - Allow logprint to copy a log to a file (-C) and to dump a log from beginning to end showing ondisk log record (-d). diff --git a/man/man8/xfs_check.8 b/man/man8/xfs_check.8 index 96480f4da..d1d3e641c 100644 --- a/man/man8/xfs_check.8 +++ b/man/man8/xfs_check.8 @@ -3,11 +3,11 @@ xfs_check \- check XFS filesystem consistency .SH SYNOPSIS .nf -\f3xfs_check\f1 [ \f3\-i\f1 ino ] ... [ \f3\-b\f1 bno ] ... \c -[ \f3\-s\f1 ] [ \f3\-v\f1 ] xfs_special +\f3xfs_check\f1 [ \f3\-i\f1 ino ] ... [ \f3\-b\f1 bno ] ... + [ \f3\-s\f1 ] [ \f3\-v\f1 ] [ \f3\-l\f1 logdev ] xfs_special .sp .8v -\f3xfs_check\f1 \f3\-f\f1 [ \f3\-i\f1 ino ] ... [ \f3\-b\f1 bno ] ... \c -[ \f3\-s\f1 ] [ \f3\-v\f1 ] file +\f3xfs_check\f1 \f3\-f\f1 [ \f3\-i\f1 ino ] ... [ \f3\-b\f1 bno ] ... + [ \f3\-s\f1 ] [ \f3\-v\f1 ] [ \f3\-l\f1 logdev ] file .fi .SH DESCRIPTION .I xfs_check @@ -31,6 +31,15 @@ Specifies that the special device is actually a file (see the This might happen if an image copy of a filesystem has been made into an ordinary file. .TP +.B \-l +Specifies the device special file where the filesystem's external +log resides. +Only for those filesystems which use an external log. +See the +\f2mkfs.xfs\f1 \f3\-l\f1 option, and refer to +.IR xfs (5) +for a detailed description of the XFS log. +.TP .B \-s Specifies that only serious errors should be reported. Serious errors are those that make it impossible to find major data diff --git a/man/man8/xfs_ncheck.8 b/man/man8/xfs_ncheck.8 index 201b43e28..134170da7 100644 --- a/man/man8/xfs_ncheck.8 +++ b/man/man8/xfs_ncheck.8 @@ -3,11 +3,11 @@ xfs_ncheck \- generate pathnames from i-numbers for XFS .SH SYNOPSIS .nf -\f3xfs_ncheck\f1 [ \f3\-i\f1 ino ] ... \c -[ \f3\-s\f1 ] xfs_special +\f3xfs_ncheck\f1 [ \f3\-i\f1 ino ] ... + [ \f3\-s\f1 ] [ \f3\-l\f1 logdev ] xfs_special .sp .8v -\f3xfs_ncheck\f1 \f3\-f\f1 [ \f3\-i\f1 ino ] ... \c -[ \f3\-s\f1 ] file +\f3xfs_ncheck\f1 \f3\-f\f1 [ \f3\-i\f1 ino ] ... + [ \f3\-s\f1 ] [ \f3\-l\f1 logdev ] file .fi .SH DESCRIPTION .I xfs_ncheck @@ -31,6 +31,15 @@ Specifies that the special device is actually a file (see the This might happen if an image copy of a filesystem has been made into an ordinary file. .TP +.B \-l +Specifies the device special file where the filesystem's external +log resides. +Only for those filesystems which use an external log. +See the +\f2mkfs.xfs\f1 \f3\-l\f1 option, and refer to +.IR xfs (5) +for a detailed description of the XFS log. +.TP .B \-s Limits the report to special files and files with setuserid mode. This option may be used to detect violations of security policy.