HomeFreeBSD

ZIL: add zil_commit_flags() to make honouring failmode= optional

Description

ZIL: add zil_commit_flags() to make honouring failmode= optional

The vast majority of calls to zil_commit() follow VFS ops, and should
honour the failmode= setting - either wait for sync, or return error.
Some calls however are part of a larger syncing op, and shouldn't ever
block if something goes wrong.

To allow this, we introduce zil_commit_flags(), with a flag
ZIL_COMMIT_FAILMODE to indicate whether or not the pool failmode should
be honoured. zil_commit() is now a wrapper that always sets this flag,
but any caller wanting a different behaviour can request ZIL_COMMIT_NOW
instead to have the call return failure if the pool suspends, regardless
of the failmode= setting.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #17398

Details

Provenance
rob.norris_klarasystems.comAuthored on Jun 17 2025, 1:33 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Aug 8 2025, 11:43 PM
Parents
rG72602f6ad9ab: ZIL: "crash" the ZIL if the pool suspends during fallback
Branches
Unknown
Tags
Unknown