From nobody Tue Oct 13 11:24:28 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4j3sRz3X3Hz6wVKD; Tue, 13 Oct 2026 11:24:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4j3sRz2sCCz4bVq; Tue, 13 Oct 2026 11:24:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791890671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KnwYnYNt2SuysJv9mOEDhGPweTijiT/NZrPPIgv5b4c=; b=w5LmB6z0NmgvN8quRGWyvhzSFk1dvTiGMbgJqYUXWE5Wp2J/1r3cFlRpQu9JDqpkojyzZO p9ZUroAf/tE8TyEbcphyZDe2o9bsEMifPK59za+ucjths3uyBQZf214C4MJ7zC4PAteFUX 08yQgnqygQujdTWcsECdUTdCWneQlrzd1eVhwg3B06stYW7SnfoQ3tj4fkNeeDw9l9jrhp SMUwJzhwS2w7MCNObyxjJjYljtF514Gs6Cwh3yfSgiA6/qarEQpWi/7IzCofRx+2eg6pRL bzcKyTd+bqaV75rzs0QY0SXPile+Y0nBLwDGrid4UI+J0waTMx884b1zSZWDFw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791890671; b=gzTSPNzOG+zzlhInn23Erv+Zw6ZDu5nDwlxpChUiSZQjgls4CsK9foIyg9E9Dl8MYsmNL0 oT73KFK6FRgTz5WlIrivSki7X21lXNziX+azom0EP11js/b2wjIyRus1GFF6DgQeTta7Tq Q84q4PwwY0ojvaZ1ZqucnJEb4SbskQK9kqA6Vrw/matW8biOcn80+EOJA6tPDJBY87pxAN VeZwNQtyr2shOdDrVvCQwlUTzt6tBY2LTPO1w2Bn8oJL2YJNqPrpQ/s6GKVnrfJr/Mbt+N F6EmOQjhjTeIYwW7ebbmu1jq3QOG2Vq0x7N7uuESFjEAulxsyp3+i1FfC3EFSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791890671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KnwYnYNt2SuysJv9mOEDhGPweTijiT/NZrPPIgv5b4c=; b=xsxxi9bAN76i9AAm44ERUf5ROIcl6y6/y0XQbIzWjEpjAMP2wSNvK7iw/ZCm+nqomgSP1v tAcPAsPoaPdw9bR2GR5skKU4ltAJQZ2fqQm7UVkOyDvQjqB3ciAb6tzMf649Rtygs3GozT iTxGzBEraIX+DA2kbcxIA2Yogdrf09O+5Nq3XWgwoqhyDkfwZOB8LriWUwp68YD1mz1k9n LsW+whDSCHNh15ZWg0zBOjDTmV+wyP2CMQcEBopvJoKMW2nFGqr33t6SEtQA14ldBQL4HJ 9AJtThE/JR3Fyy9oSz5sYUE8NmB1DpP2eb+Sg/+Je/oOxcBA3k5ea8FlktSv8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "YR1" (not verified)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4j3sRz0cv5zrcf; Tue, 13 Oct 2026 11:24:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id E168A1E3FC; Tue, 13 Oct 2026 13:24:28 +0200 (CEST) From: Kristof Provost To: Maxim Sobolev Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: afe1dec7425c - main - tests: add UFS synchronous write durability tests Date: Tue, 13 Oct 2026 13:24:28 +0200 X-Mailer: MailMate (2.0r6272) Message-ID: <6F9C3839-BD16-4C10-B8B0-75D1F463843D@FreeBSD.org> In-Reply-To: <6acdb3c5.30b1c.5ddfa2ff@gitrepo.freebsd.org> References: <6acdb3c5.30b1c.5ddfa2ff@gitrepo.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: Commit messages for the main branch of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_MailMate_8184A0A8-92C0-4756-963B-00DD4425A963_=" --=_MailMate_8184A0A8-92C0-4756-963B-00DD4425A963_= Content-Type: text/plain; charset=UTF-8; format=flowed; markup=markdown Content-Transfer-Encoding: quoted-printable On 13 Oct 2026, at 6:29, Maxim Sobolev wrote: > The branch main has been updated by sobomax: > > URL: = > https://cgit.FreeBSD.org/src/commit/?id=3Dafe1dec7425c9f3bec1aafcfed152= 29a385894eb > > commit afe1dec7425c9f3bec1aafcfed15229a385894eb > Author: Maxim Sobolev > AuthorDate: 2026-10-13 02:45:12 +0000 > Commit: Maxim Sobolev > CommitDate: 2026-10-13 04:28:32 +0000 > > tests: add UFS synchronous write durability tests > > Check that once fsync(2), fdatasync(2), or a write(2) with O_SYNC = > or > O_DSYNC returns, the new data, the file size and every block = > pointer > leading to the data are on disk. The cases append a block, fill a = > hole, > append the first block that needs an indirect block and append = > below an > existing indirect block. Two more append after another write left = > a > new direct block unsynced, which with soft updates cuts the size = > and the > later pointers of an inode written meanwhile. With O_SYNC and = > O_DSYNC > on soft updates, those also check that the open already made the > unsynced block durable. > Each case runs on UFS without soft updates, with soft updates and = > with > SU+J. > > The file systems live on md(4) and the checks read the inode, the > indirect block and the data block straight from the device with = > libufs > right after the synchronous call returns. There is no cache in = > front > of the disk device, so this shows what would survive a crash at = > that > moment without having to crash anything. > > Sponsored by: Sippy Software, Inc. > Reviewed by: pho > Tested by: pho > Differential Revision: https://reviews.freebsd.org/D60134 > MFC after: 1 month > This fails to build for me (amd64): --- all_subdir_tests/sys/fs/ufs --- /usr/src/tests/sys/fs/ufs/sync_test.c:226:9: error: cast from 'uint8_t = *' (aka 'unsigned char *') to 'ufs1_daddr_t *' (aka 'int *') increases = required alignment from 1 to 4 [-Werror,-Wcast-align] 226 | ((ufs1_daddr_t *)buf)[lbn - = UFS_NDADDR] : | ^~~~~~~~~~~~~~~~~~~ /usr/src/tests/sys/fs/ufs/sync_test.c:227:9: error: cast from 'uint8_t = *' (aka 'unsigned char *') to 'ufs2_daddr_t *' (aka 'long *') increases = required alignment from 1 to 8 [-Werror,-Wcast-align] 227 | ((ufs2_daddr_t *)buf)[lbn - = UFS_NDADDR]; | ^~~~~~~~~~~~~~~~~~~ =E2=80=94 Kristof --=_MailMate_8184A0A8-92C0-4756-963B-00DD4425A963_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 13 Oct 2026, at 6:29, Maxim Sobolev wrote:

The branch main has been updated by sobomax:

URL: https://cgit.FreeBSD.org/src/co= mmit/?id=3Dafe1dec7425c9f3bec1aafcfed15229a385894eb

commit afe1dec7425c9f3bec1aafcfed15229a385894eb
Author: Maxim Sobolev sobomax@= FreeBSD.org
AuthorDate: 2026-10-13 02:45:12 +0000
Commit: Maxim Sobolev sobomax@= FreeBSD.org
CommitDate: 2026-10-13 04:28:32 +0000

te=
sts: add UFS synchronous write durability tests

Check that once fsync(2), fdatasync(2), or a write(2) with O_SYNC or
O_DSYNC returns, the new data, the file size and every block pointer
leading to the data are on disk.  The cases append a block, fill a hole,
append the first block that needs an indirect block and append below an
existing indirect block.  Two more append after another write left a
new direct block unsynced, which with soft updates cuts the size and the
later pointers of an inode written meanwhile.  With O_SYNC and O_DSYNC
on soft updates, those also check that the open already made the
unsynced block durable.
Each case runs on UFS without soft updates, with soft updates and with
SU+J.

The file systems live on md(4) and the checks read the inode, the
indirect block and the data block straight from the device with libufs
right after the synchronous call returns.  There is no cache in front
of the disk device, so this shows what would survive a crash at that
moment without having to crash anything.

Sponsored by:   Sippy Software, Inc.
Reviewed by:    pho
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D60134
MFC after:      1 month

This fails to build for me (amd64):

--=
- all_subdir_tests/sys/fs/ufs ---
/usr/src/tests/sys/fs/ufs/sync_test.c:226:9: error: cast from 'uint8_t *'=
 (aka 'unsigned char *') to 'ufs1_daddr_t *' (aka 'int *') increases requ=
ired alignment from 1 to 4 [-Werror,-Wcast-align]
  226 |                             ((ufs1_daddr_t *)buf)[lbn - UFS_NDADD=
R] :
      |                              ^~~~~~~~~~~~~~~~~~~
/usr/src/tests/sys/fs/ufs/sync_test.c:227:9: error: cast from 'uint8_t *'=
 (aka 'unsigned char *') to 'ufs2_daddr_t *' (aka 'long *') increases req=
uired alignment from 1 to 8 [-Werror,-Wcast-align]
  227 |                             ((ufs2_daddr_t *)buf)[lbn - UFS_NDADD=
R];
      |                              ^~~~~~~~~~~~~~~~~~~

=E2=80=94
Kristof

--=_MailMate_8184A0A8-92C0-4756-963B-00DD4425A963_=--