aboutsummaryrefslogtreecommitdiff
path: root/sbin/fsck_ffs/fsutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/fsck_ffs/fsutil.c')
-rw-r--r--sbin/fsck_ffs/fsutil.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c
index 98db9e2d50f5..94ea2cf792bf 100644
--- a/sbin/fsck_ffs/fsutil.c
+++ b/sbin/fsck_ffs/fsutil.c
@@ -217,6 +217,9 @@ bufinit(void)
/*
* Manage cylinder group buffers.
+ *
+ * Use getblk() here rather than cgget() because the cylinder group
+ * may be corrupted but we want it anyway so we can fix it.
*/
static struct bufarea *cgbufs; /* header for cylinder group cache */
static int flushtries; /* number of tries to reclaim memory */
@@ -370,7 +373,7 @@ flush(int fd, struct bufarea *bp)
fsmodified = 1;
break;
case BT_CYLGRP:
- if (cgput(&disk, bp->b_un.b_cg) == 0)
+ if (cgput(fswritefd, &sblock, bp->b_un.b_cg) == 0)
fsmodified = 1;
break;
default: