aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Wing <rew@FreeBSD.org>2021-06-03 01:41:31 +0000
committerRobert Wing <rew@FreeBSD.org>2021-06-11 16:56:00 +0000
commit47ec64b3e801cbb793ccff49d21bc8eeb219ad9f (patch)
tree79277a27845e46c6f8ad941f3176b097779e5aef
parent157a960058c221bda068c902ba9ccf216fa2fbaa (diff)
downloadsrc-47ec64b3e801cbb793ccff49d21bc8eeb219ad9f.tar.gz
src-47ec64b3e801cbb793ccff49d21bc8eeb219ad9f.zip
fsck_ufs: fix segfault with gjournal
The segfault was being hit in ckfini() (sbin/fsck_ffs/fsutil.c) while attempting to traverse the buffer cache. The tail queue used for the buffer cache was not initialized before dropping into gjournal_check(). Initialize the buffer cache before calling gjournal_check(). PR: 245907 Reviewed by: jhb, mckusick Differential Revision: https://reviews.freebsd.org/D30537 (cherry picked from commit 441e69e419effac0225a45f4cdb948280b8ce5ab)
-rw-r--r--sbin/fsck_ffs/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c
index 401ee10f9be3..67aff2dde73c 100644
--- a/sbin/fsck_ffs/main.c
+++ b/sbin/fsck_ffs/main.c
@@ -309,6 +309,7 @@ checkfilesys(char *filesys)
exit(0);
}
if ((sblock.fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) == 0) {
+ bufinit();
gjournal_check(filesys);
if (chkdoreload(mntp) == 0)
exit(0);