aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorAlexander Motin <[email protected]>2021-05-24 16:42:45 -0400
committerGitHub <[email protected]>2021-05-24 14:42:45 -0600
commitf8646c871a422046fba7eb24c0cdfc53b5ffc546 (patch)
tree27aa0ce780003309afa2a7295bf0cf99daee4a58 /module
parent5d1a32a542125e5ed10ef97112a07da242357917 (diff)
FreeBSD: Retry OCF ENOMEM errors.
ZFS does not expect transient errors from crypto. For read they are counted as checksum errors, while for write end up in panic. To not panic on random low memory conditions retry ENOMEM errors in the OCF wrapper function. While there remove unneeded timeout and priority from msleep(). External-issue: https://reviews.freebsd.org/D30339 Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Mark Maybee <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored-By: iXsystems, Inc. Closes #12077
Diffstat (limited to 'module')
-rw-r--r--module/os/freebsd/zfs/crypto_os.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/module/os/freebsd/zfs/crypto_os.c b/module/os/freebsd/zfs/crypto_os.c
index 03d14ed7c..6a67dbc9f 100644
--- a/module/os/freebsd/zfs/crypto_os.c
+++ b/module/os/freebsd/zfs/crypto_os.c
@@ -172,11 +172,13 @@ zfs_crypto_dispatch(freebsd_crypt_session_t *session, struct cryptop *crp)
break;
mtx_lock(&session->fs_lock);
while (session->fs_done == false)
- msleep(crp, &session->fs_lock, PRIBIO,
- "zfs_crypto", hz/5);
+ msleep(crp, &session->fs_lock, 0,
+ "zfs_crypto", 0);
mtx_unlock(&session->fs_lock);
- if (crp->crp_etype != EAGAIN) {
+ if (crp->crp_etype == ENOMEM) {
+ pause("zcrnomem", 1);
+ } else if (crp->crp_etype != EAGAIN) {
error = crp->crp_etype;
break;
}