Add e2fs_fsmnt, and the newly defined e2fs_kbytes_written to the list of
authormartijn <martijn@openbsd.org>
Mon, 15 Jul 2024 13:32:50 +0000 (13:32 +0000)
committermartijn <martijn@openbsd.org>
Mon, 15 Jul 2024 13:32:50 +0000 (13:32 +0000)
fields that can differ between the primary and 1st backup superblock.

This fixes fsck issues I've encountered on my system with a shared home
partition.

OK miod@

sbin/fsck_ext2fs/setup.c

index 1b11f10..d150896 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: setup.c,v 1.33 2019/07/01 07:13:44 kevlo Exp $        */
+/*     $OpenBSD: setup.c,v 1.34 2024/07/15 13:32:50 martijn Exp $      */
 /*     $NetBSD: setup.c,v 1.1 1997/06/11 11:22:01 bouyer Exp $ */
 
 /*
@@ -347,6 +347,10 @@ readsb(int listerr)
        asblk.b_un.b_fs->e2fs_features_rocompat &= ~EXT2F_ROCOMPAT_LARGE_FILE;
        asblk.b_un.b_fs->e2fs_features_rocompat |=
            sblk.b_un.b_fs->e2fs_features_rocompat & EXT2F_ROCOMPAT_LARGE_FILE;
+       memcpy(asblk.b_un.b_fs->e2fs_fsmnt, sblk.b_un.b_fs->e2fs_fsmnt,
+           sizeof(sblk.b_un.b_fs->e2fs_fsmnt));
+       asblk.b_un.b_fs->e2fs_kbytes_written = sblk.b_un.b_fs->e2fs_kbytes_written;
+
        if (sblock.e2fs.e2fs_rev > E2FS_REV0 &&
            ((sblock.e2fs.e2fs_features_incompat & ~EXT2F_INCOMPAT_SUPP) ||
            (sblock.e2fs.e2fs_features_rocompat & ~EXT2F_ROCOMPAT_SUPP))) {