Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/fsck_ffs Fix misleading fsck_ffs messages about wapbl j...



details:   https://anonhg.NetBSD.org/src/rev/e5e963caa187
branches:  trunk
changeset: 368659:e5e963caa187
user:      dholland <dholland%NetBSD.org@localhost>
date:      Mon Jul 25 05:15:08 2022 +0000

description:
Fix misleading fsck_ffs messages about wapbl journal replay.

Apparently fsck doesn't have a way to replay it to its internal memory
only. (Someone(TM) should implement this...)

This means that if you use -n, it can't replay the journal. But the
sequence of prints is such that it looks like it did. This is quite
misleading. Add an additional specific warning.

diffstat:

 sbin/fsck_ffs/wapbl.c |  15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r b0f45a6b83c5 -r e5e963caa187 sbin/fsck_ffs/wapbl.c
--- a/sbin/fsck_ffs/wapbl.c     Mon Jul 25 01:59:26 2022 +0000
+++ b/sbin/fsck_ffs/wapbl.c     Mon Jul 25 05:15:08 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wapbl.c,v 1.5 2010/03/06 11:31:40 mlelstv Exp $        */
+/*     $NetBSD: wapbl.c,v 1.6 2022/07/25 05:15:08 dholland Exp $       */
 
 /*-
  * Copyright (c) 2005,2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #define WAPBL_INTERNAL
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wapbl.c,v 1.5 2010/03/06 11:31:40 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wapbl.c,v 1.6 2022/07/25 05:15:08 dholland Exp $");
 
 #include <sys/stat.h>
 #include <sys/time.h>
@@ -92,7 +92,16 @@
 {
        int error;
 
-       if (!nflag) {
+       if (nflag) {
+               /*
+                * XXX: we ought to have a mode where we can replay
+                * the journal to memory, similar to what happens in
+                * the kernel with a readonly mount. For now though
+                * just print that we aren't doing it so as to avoid
+                * lying to the user.
+                */
+               pwarn("CANNOT REPLAY JOURNAL IN -n MODE; continuing anyway\n");
+       } else {
                error = wapbl_replay_write(wapbl_replay, 0);
                if (error) {
                        pfatal("UNABLE TO REPLAY JOURNAL BLOCKS");



Home | Main Index | Thread Index | Old Index