1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

fsck_ffs: don't try to write in read-only mode

(cherry picked from commit ed1a156b03)

Sponsored by:	Netflix
This commit is contained in:
Chuck Silvers 2021-06-29 14:29:15 -07:00 committed by Kirk McKusick
parent 11045f1b73
commit a0c3799828

View File

@ -364,17 +364,19 @@ checkfilesys(char *filesys)
sujrecovery = 0;
printf("** Skipping journal, falling through to full fsck\n\n");
}
/*
* Write the superblock so we don't try to recover the
* 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;
if (fswritefd != -1) {
/*
* Write the superblock so we don't try to recover the
* 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;
}
}
/*
* If the filesystem was run on an old kernel that did not