Re: git: 077f757d72e5 - main - newfs_msdos: align data area to VM page boundary by default

From: Konstantin Belousov <kostikbel_at_gmail.com>
Date: Tue, 04 Jun 2024 22:25:29 UTC
On Tue, Jun 04, 2024 at 08:39:16AM +0200, Stefan Eßer wrote:
> Am 03.06.24 um 19:25 schrieb Jessica Clarke:
> > On 2 Jun 2024, at 13:27, Stefan Eßer <se@FreeBSD.org> wrote:
> > > 
> > > The branch main has been updated by se:
> > > 
> > > URL: https://cgit.FreeBSD.org/src/commit/?id=077f757d72e561eb84193d8e58f63e96e69b8096
> > > 
> > > commit 077f757d72e561eb84193d8e58f63e96e69b8096
> > > Author:     Stefan Eßer <se@FreeBSD.org>
> > > AuthorDate: 2024-06-02 12:07:52 +0000
> > > Commit:     Stefan Eßer <se@FreeBSD.org>
> > > CommitDate: 2024-06-02 12:07:52 +0000
> > > 
> > >     newfs_msdos: align data area to VM page boundary by default
> [...]
> > 
> > Hi,
> > This has completely broken[1] all of the Linux and macOS cross-build CI
> > jobs (which pass -DWITH_DISK_IMAGE_TOOLS_BOOTSTRAP). Please either fix
> > this promptly or back it out until you can do so.
> > 
> > Jess
> > 
> > [1] See https://github.com/freebsd/freebsd-src/actions/runs/9338256762
> 
> Thank you for the report and sorry for the breakage.
> 
> This should be fixed in commit 41ee91c64f47faaa by skipping the
> alignment of the data area, if PAGE_SIZE is not defined.
> 
> An alternative approach would have been to define PAGE_SIZE to a
> sane default value of 4096 (as used on most current architectures
> by default), if not set in the build environment.
> 
> If there is consensus that this would be more appropriate (since
> it matches what the man page says), I'd revert the latest commit
> and instead of it commit the following change:
I believe this is a better approach.
It does not unexpectedly hide some code.

> 
> index 1bca560a59e1..c4f18a28ec39 100644
> --- a/sbin/newfs_msdos/mkfs_msdos.c
> +++ b/sbin/newfs_msdos/mkfs_msdos.c
> @@ -55,6 +55,10 @@
> 
>  #include "mkfs_msdos.h"
> 
> +#ifndef        PAGE_SIZE
> +#define        PAGE_SIZE 4096
> +#endif
> +
>  #define        MAXU16    0xffff        /* maximum unsigned 16-bit quantity */
>  #define        BPN       4             /* bits per nibble */
>  #define        NPB       2             /* nibbles per byte */
> 
> Regards, STefan