Page MenuHomeFreeBSD

newfs_msdos: fix type of kern.maxphys; connect ATF test from NetBSD
ClosedPublic

Authored by vangyzen on Jan 31 2022, 8:46 PM.
Tags
None
Referenced Files
F106177056: D34116.id102843.diff
Thu, Dec 26, 4:11 PM
F106147032: D34116.diff
Thu, Dec 26, 4:20 AM
Unknown Object (File)
Fri, Dec 6, 6:33 PM
Unknown Object (File)
Fri, Dec 6, 3:24 AM
Unknown Object (File)
Thu, Dec 5, 12:11 PM
Unknown Object (File)
Sun, Dec 1, 2:58 PM
Unknown Object (File)
Nov 12 2024, 5:47 AM
Unknown Object (File)
Nov 3 2024, 7:05 PM
Subscribers

Details

Summary

The type of the kern.maxphys sysctl OID is now ulong. Change the
local variable type to match.

NetBSD has an ATF test for newfs_msdos. Connect it to the build.
Adapt it for FreeBSD. This would have caught this bug.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sbin/newfs_msdos/mkfs_msdos.c
845

This file will be a separate commit.

LGTM
I think the way we handle contrib NetBSD tests is strange but that's beyond the scope of this change

This revision is now accepted and ready to land.Jan 31 2022, 8:50 PM

This could also be handled in the Makefile to avoid having to dance around FreeBSD vs NetBSD in the test, since I assume we'll never upstream the utility name item and will always deviate from NetBSD.

Examples in use:

bin/expr/tests/Makefile:ATF_TESTS_SH_SED_expr_test+=    -e 's/eval expr/eval expr --/g'
bin/expr/tests/Makefile:ATF_TESTS_SH_SED_expr_test+=    -e 's/"expr: integer overflow or underflow occurred for operation.*"/"expr: overflow"/g'
usr.bin/diff/tests/Makefile:ATF_TESTS_SH_SED_netbsd_diff_test+= -e 's/t_diff/`basename $$0`/g'
usr.bin/sed/tests/Makefile:ATF_TESTS_SH_SED_sed_test+=  -e 's,atf_expect_fail "PR bin/28126",,g'
In D34116#771685, @ngie wrote:

This could also be handled in the Makefile to avoid having to dance around FreeBSD vs NetBSD in the test, since I assume we'll never upstream the utility name item and will always deviate from NetBSD.

Please no, we used to have lots of cases of applying patches at build time etc. and it results in obfuscation and awkwardness. It made some sense in the CVS days when there was a cost to bringing a file off the vendor branch but we're much better served by using contemporary source management tools to manage it for us.