From ffc58b342995c6537f442db710ab213c057f968d Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Tue, 24 Jul 2012 19:42:18 +0200 Subject: [PATCH] cwfs: make sure we do a full dump after toggling noatime --- sys/src/cmd/cwfs/all.h | 1 + sys/src/cmd/cwfs/con.c | 1 + sys/src/cmd/cwfs/config.c | 6 ++---- sys/src/cmd/cwfs/cw.c | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/src/cmd/cwfs/all.h b/sys/src/cmd/cwfs/all.h index 05d5d4c48..a74be73d8 100644 --- a/sys/src/cmd/cwfs/all.h +++ b/sys/src/cmd/cwfs/all.h @@ -85,6 +85,7 @@ ulong authdebugflag; int noattach; /* attach is disabled */ int noauth; /* auth is disable */ int noatime; /* atime is disabled */ +int noatimeset; /* noatime was changed (reset after dump) */ int wstatallow; /* set to circumvent wstat permissions */ int writeallow; /* set to circumvent write permissions */ int duallow; /* single user to allow du */ diff --git a/sys/src/cmd/cwfs/con.c b/sys/src/cmd/cwfs/con.c index 496915d0e..fb5be9666 100644 --- a/sys/src/cmd/cwfs/con.c +++ b/sys/src/cmd/cwfs/con.c @@ -697,6 +697,7 @@ void cmd_noatime(int, char *[]) { noatime = !noatime; + noatimeset++; print("atime %s\n", noatime ? "disabled" : "enabled"); } diff --git a/sys/src/cmd/cwfs/config.c b/sys/src/cmd/cwfs/config.c index 8609790a8..a9c87bb6c 100644 --- a/sys/src/cmd/cwfs/config.c +++ b/sys/src/cmd/cwfs/config.c @@ -21,9 +21,8 @@ static Device* confdev; static int copyworm = 0, copydev = 0; static char *src, *dest; -static int noauthset = 0; -static int noatimeset = 0; -static int readonlyset = 0; +static int noauthset; +static int readonlyset; static int resetparams; Fspar fspar[] = { @@ -613,7 +612,6 @@ start: putbuf(p); f.modconf = f.newconf = 0; - noauthset = noatimeset = readonlyset = 0; goto start; } putbuf(p); diff --git a/sys/src/cmd/cwfs/cw.c b/sys/src/cmd/cwfs/cw.c index 26475f0c1..351f3d09f 100644 --- a/sys/src/cmd/cwfs/cw.c +++ b/sys/src/cmd/cwfs/cw.c @@ -1491,7 +1491,8 @@ cfsdump(Filsys *fs) if(chatty) fprint(2, "cwroot %lld", (Wideoff)orba); cons.noage = 1; - cw->all = cw->allflag | noatime; + cw->all = cw->allflag | noatime | noatimeset; + noatimeset = 0; rba = cwrecur(cw, orba, Tsuper, 0, QPROOT); if(rba == 0) rba = orba;