Eliminate unnecessary UFS1 integrity checks.

The UFS1 integrity checks added in FreeBSD 14 were too aggressive
for UFS1 filesystems created in FreeBSD 4 and 9 systems. This patch
removes those tests which can be done safely since they are not
relevant to the current implementation of UFS1.

This is a follow-on report to bug report 264450 (comments 21-28).

Reported by: slb@sonnet.com
Tested by:   slb@sonnet.com
PR:          264450

(cherry picked from commit b241767f8e)
This commit is contained in:
Kirk McKusick 2024-02-19 16:16:07 -08:00
parent bf58a77ae1
commit 8c6964b779
2 changed files with 0 additions and 4 deletions

View File

@ -1023,7 +1023,6 @@ check_cgmagic(int cg, struct bufarea *cgbp)
CHK(cgp->cg_ndblk, >, sblock.fs_fpg, "%jd"); CHK(cgp->cg_ndblk, >, sblock.fs_fpg, "%jd");
if (sblock.fs_magic == FS_UFS1_MAGIC) { if (sblock.fs_magic == FS_UFS1_MAGIC) {
CHK(cgp->cg_old_niblk, !=, sblock.fs_ipg, "%jd"); CHK(cgp->cg_old_niblk, !=, sblock.fs_ipg, "%jd");
CHK(cgp->cg_old_ncyl, >, sblock.fs_old_cpg, "%jd");
} else if (sblock.fs_magic == FS_UFS2_MAGIC) { } else if (sblock.fs_magic == FS_UFS2_MAGIC) {
CHK(cgp->cg_niblk, !=, sblock.fs_ipg, "%jd"); CHK(cgp->cg_niblk, !=, sblock.fs_ipg, "%jd");
CHK(cgp->cg_initediblk, >, sblock.fs_ipg, "%jd"); CHK(cgp->cg_initediblk, >, sblock.fs_ipg, "%jd");
@ -1040,7 +1039,6 @@ check_cgmagic(int cg, struct bufarea *cgbp)
} else if (sblock.fs_magic == FS_UFS1_MAGIC) { } else if (sblock.fs_magic == FS_UFS1_MAGIC) {
CHK(cgp->cg_niblk, !=, 0, "%jd"); CHK(cgp->cg_niblk, !=, 0, "%jd");
CHK(cgp->cg_initediblk, !=, 0, "%jd"); CHK(cgp->cg_initediblk, !=, 0, "%jd");
CHK(cgp->cg_old_ncyl, !=, sblock.fs_old_cpg, "%jd");
CHK(cgp->cg_old_niblk, !=, sblock.fs_ipg, "%jd"); CHK(cgp->cg_old_niblk, !=, sblock.fs_ipg, "%jd");
CHK(cgp->cg_old_btotoff, !=, start, "%jd"); CHK(cgp->cg_old_btotoff, !=, start, "%jd");
CHK(cgp->cg_old_boff, !=, cgp->cg_old_btotoff + CHK(cgp->cg_old_boff, !=, cgp->cg_old_btotoff +

View File

@ -398,10 +398,8 @@ validate_sblock(struct fs *fs, int isaltsblk)
CHK(fs->fs_old_cpc, !=, 0, %jd); CHK(fs->fs_old_cpc, !=, 0, %jd);
CHK(fs->fs_old_postblformat, !=, 1, %jd); CHK(fs->fs_old_postblformat, !=, 1, %jd);
CHK(fs->fs_old_nrpos, !=, 1, %jd); CHK(fs->fs_old_nrpos, !=, 1, %jd);
CHK(fs->fs_old_spc, !=, fs->fs_fpg * fs->fs_old_nspf, %jd);
CHK(fs->fs_old_nsect, !=, fs->fs_old_spc, %jd); CHK(fs->fs_old_nsect, !=, fs->fs_old_spc, %jd);
CHK(fs->fs_old_npsect, !=, fs->fs_old_spc, %jd); CHK(fs->fs_old_npsect, !=, fs->fs_old_spc, %jd);
CHK(fs->fs_old_ncyl, !=, fs->fs_ncg, %jd);
} else { } else {
/* Bad magic number, so assume not a superblock */ /* Bad magic number, so assume not a superblock */
return (ENOENT); return (ENOENT);