From 29340eaf0ea47f351ba21683975168f9a0cefcac Mon Sep 17 00:00:00 2001 From: mckusick Date: Mon, 16 Oct 2017 21:53:29 +0000 Subject: [PATCH] MFC of 324456. Do not report filesystem as modified if only timestamp updated in superblock. --- sbin/fsck_ffs/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c index 8f0e1db57db..22a683b9b04 100644 --- a/sbin/fsck_ffs/main.c +++ b/sbin/fsck_ffs/main.c @@ -231,6 +231,7 @@ checkfilesys(char *filesys) struct group *grp; struct iovec *iov; char errmsg[255]; + int ofsmodified; int iovlen; int cylno; intmax_t blks, files; @@ -425,10 +426,15 @@ checkfilesys(char *filesys) } /* * Write the superblock so we don't try to recover the - * journal on another pass. + * journal on another pass. If this is the only change + * to the filesystem, we do not want it to be called + * out as modified. */ sblock.fs_mtime = time(NULL); sbdirty(); + ofsmodified = fsmodified; + flush(fswritefd, &sblk); + fsmodified = ofsmodified; } /* -- 2.45.0