mirror_zfs/module
Brian Behlendorf 48ce292ea0
Clarify and restrict dmu_tx_assign() errors
There are three possible cases where dmu_tx_assign() may
encounter a fatal error.  When there is a true lack of free
space (ENOSPC), when there is a lack of quota space (EDQUOT),
or when data required to perform the transaction cannot be
read from disk (EIO).  See the dmu_tx_check_ioerr() function
for additional details of on the motivation for check for
I/O error early.

Prior to this change dmu_tx_assign() would return the
contents of tx->tx_err which covered a wide range of possible
error codes (EIO, ECKSUM, ESRCH, etc).  In practice, none
of the callers could do anything useful with this level of
detail and simply returned the error.

Therefore, this change converts all tx->tx_err errors to EIO,
adds ASSERTs to dmu_tx_assign() to cover the only possible
errors, and clarifies the function comment to include EIO as
a possible fatal error.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Brian D Behlendorf <behlendo@slag12.llnl.gov>
Closes #17463
2025-06-23 15:48:30 -04:00
..
avl SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
icp Linux build: silence objtool warnings 2025-06-04 17:40:09 -07:00
lua SPDX: license tags: MIT 2025-03-13 17:56:54 -07:00
nvpair nvlist: Add nvlist_snprintf() and zfs_dbgmsg_nvlist() 2025-04-18 09:22:16 -04:00
os FreeBSD: Wire projects support 2025-06-19 14:39:20 -07:00
unicode SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zcommon events: include zio type in IO error reports 2025-05-30 10:29:29 -04:00
zfs Clarify and restrict dmu_tx_assign() errors 2025-06-23 15:48:30 -04:00
zstd SPDX: license tags: BSD-3-Clause OR GPL-2.0-only 2025-03-13 17:57:17 -07:00
.gitignore FreeBSD: Ignore symlink to i386 includes 2022-08-02 16:34:23 -07:00
Kbuild.in Linux build: always use objtool 2025-05-29 18:04:20 -07:00
Makefile.bsd freebsd: unbreak module/Makefile.bsd build on 15-CURRENT-arm64 2025-04-05 19:43:41 -04:00
Makefile.in Linux build: handle CONFIG_OBJTOOL_WERROR=y 2025-06-16 08:12:09 -07:00