]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_check now looks to see if the log is dirty before running.
authorNathan Scott <nathans@sgi.com>
Wed, 9 Jun 2004 11:38:17 +0000 (11:38 +0000)
committerNathan Scott <nathans@sgi.com>
Wed, 9 Jun 2004 11:38:17 +0000 (11:38 +0000)
12 files changed:
VERSION
db/check.c
db/sb.c
db/sb.h
db/xfs_check.sh
db/xfs_check64.sh
db/xfs_ncheck.sh
db/xfs_ncheck64.sh
debian/changelog
doc/CHANGES
man/man8/xfs_check.8
man/man8/xfs_ncheck.8

diff --git a/VERSION b/VERSION
index 392fe8613a802d29ba26e45302e5fa83ff264a19..d822914baa9be7050b1b2b796a690fcdf8823cbe 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -3,5 +3,5 @@
 #
 PKG_MAJOR=2
 PKG_MINOR=6
-PKG_REVISION=14
+PKG_REVISION=15
 PKG_BUILD=1
index a84888718dbd15de50ecd885615bee7aa285e94b..ad09eb3e43171860cec57aa924ea8ccca1c3664d 100644 (file)
@@ -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 67ec56051f4785d375cbdd6da0372e1090b25f6c..8e5b81983a1421a164b3d9687c2b10f24640a5ab 100644 (file)
--- 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 0ec544f39d2a1d4c5b10816fcc3e44af2a378411..013b32e7e9676bceea2fc7b1e5022d97a74ebd9e 100644 (file)
--- 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);
index 7866cfb26bfb65d4e426a33d6e56026ef13cb4f9..a0afcaffe1f38d61dbde1b5f50c73819820e2142 100755 (executable)
 #
 
 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
index 5c6dcaaea72c8591b59725d4c499e03a2cf674a1..f28a832041ade32b0d2ba326c7f885453c84a851 100755 (executable)
 #
 
 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
index 5ac5741ec953d167db4888bec7be976d992af4c5..e6ebc126a21a5ab0a1e3c5969f0fcb4a6f47df89 100755 (executable)
 #
 
 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
index 3fa4aafe53d0bf70f0479a735b828b3d97edba0d..a0f3dce5bcb212ed3b8a3b514ccf58025181a2f6 100755 (executable)
 #
 
 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
index 6deda9fc021d3e0fa597bdf7f906789e6563347e..e37313014c39a4dee2f467f6673ecf501d743736 100644 (file)
@@ -1,3 +1,9 @@
+xfsprogs (2.6.15-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Nathan Scott <nathans@debian.org>  Wed, 09 Jun 2004 21:10:14 +1000
+
 xfsprogs (2.6.14-1) unstable; urgency=low
 
   * New upstream release.
index 5fd5dea6df21d3195fed8c9e363191d8c382242d..841c2944b952bea15e78c88458b5c9ced3bc6b99 100644 (file)
@@ -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).
index 96480f4da7b51e2d978f08df24832524d032a8a4..d1d3e641cdfdc241f464d416b882eb8ca3bbc694 100644 (file)
@@ -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
index 201b43e283995835849c2b71cd2737c4d6ecee63..134170da7bd002ea0fac83d3da9c3aaf1b9a43ef 100644 (file)
@@ -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.