Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F116014605
D50104.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D50104.diff
View Options
diff --git a/share/man/man9/crypto_request.9 b/share/man/man9/crypto_request.9
--- a/share/man/man9/crypto_request.9
+++ b/share/man/man9/crypto_request.9
@@ -466,17 +466,6 @@
.Fn crypto_done .
.It Fa crp_flags
A bitmask of flags.
-The following flags are available in addition to flags discussed previously:
-.Bl -tag -width CRYPTO_F_DONE
-.It Dv CRYPTO_F_DONE
-Set by
-.Fa crypto_done
-before calling
-.Fa crp_callback .
-This flag is not very useful and will likely be removed in the future.
-It can only be safely checked from the callback routine at which point
-it is always set.
-.El
.It Fa crp_cipher_key
Pointer to a request-specific encryption key.
If this value is not set,
diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/crypto_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/crypto_os.c
--- a/sys/contrib/openzfs/module/os/freebsd/zfs/crypto_os.c
+++ b/sys/contrib/openzfs/module/os/freebsd/zfs/crypto_os.c
@@ -196,7 +196,6 @@
break;
}
crp->crp_etype = 0;
- crp->crp_flags &= ~CRYPTO_F_DONE;
session->fs_done = false;
}
return (error);
diff --git a/sys/kgssapi/krb5/kcrypto_aes.c b/sys/kgssapi/krb5/kcrypto_aes.c
--- a/sys/kgssapi/krb5/kcrypto_aes.c
+++ b/sys/kgssapi/krb5/kcrypto_aes.c
@@ -123,12 +123,14 @@
return (0);
error = crp->crp_etype;
- if (error == EAGAIN)
+ if (error == EAGAIN) {
error = crypto_dispatch(crp);
- mtx_lock(&as->as_lock);
- if (error || (crp->crp_flags & CRYPTO_F_DONE))
+ } else {
+ mtx_lock(&as->as_lock);
+ crp->crp_flags |= CRYPTO_F_DONE;
wakeup(crp);
- mtx_unlock(&as->as_lock);
+ mtx_unlock(&as->as_lock);
+ }
return (0);
}
@@ -168,7 +170,8 @@
error = msleep(crp, &as->as_lock, 0, "gssaes", 0);
mtx_unlock(&as->as_lock);
}
-
+ if (crp->crp_etype != 0)
+ panic("%s: crypto req failed: %d", __func__, crp->crp_etype);
crypto_freereq(crp);
}
@@ -339,6 +342,8 @@
mtx_unlock(&as->as_lock);
}
+ if (crp->crp_etype != 0)
+ panic("%s: crypto req failed: %d", __func__, crp->crp_etype);
crypto_freereq(crp);
}
diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c
--- a/sys/opencrypto/crypto.c
+++ b/sys/opencrypto/crypto.c
@@ -1263,8 +1263,6 @@
crp->crp_obuf.cb_type <= CRYPTO_BUF_LAST,
("incoming crp with invalid output buffer type"));
KASSERT(crp->crp_etype == 0, ("incoming crp with error"));
- KASSERT(!(crp->crp_flags & CRYPTO_F_DONE),
- ("incoming crp already done"));
csp = &crp->crp_session->csp;
cb_sanity(&crp->crp_buf, "input");
@@ -1653,7 +1651,6 @@
{
struct cryptop *new;
- MPASS((crp->crp_flags & CRYPTO_F_DONE) == 0);
new = crypto_getreq(cses, how);
if (new == NULL)
return (NULL);
@@ -1669,9 +1666,6 @@
void
crypto_done(struct cryptop *crp)
{
- KASSERT((crp->crp_flags & CRYPTO_F_DONE) == 0,
- ("crypto_done: op already done, flags 0x%x", crp->crp_flags));
- crp->crp_flags |= CRYPTO_F_DONE;
if (crp->crp_etype != 0)
CRYPTOSTAT_INC(cs_errs);
diff --git a/sys/opencrypto/cryptodev.h b/sys/opencrypto/cryptodev.h
--- a/sys/opencrypto/cryptodev.h
+++ b/sys/opencrypto/cryptodev.h
@@ -433,7 +433,7 @@
int crp_flags;
#define CRYPTO_F_CBIMM 0x0010 /* Do callback immediately */
-#define CRYPTO_F_DONE 0x0020 /* Operation completed */
+#define CRYPTO_F_DONE 0x0020 /* For use by consumers, if needed */
#define CRYPTO_F_CBIFSYNC 0x0040 /* Do CBIMM if op is synchronous */
#define CRYPTO_F_ASYNC_ORDERED 0x0100 /* Completions must happen in order */
#define CRYPTO_F_IV_SEPARATE 0x0200 /* Use crp_iv[] as IV. */
diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c
--- a/sys/opencrypto/cryptodev.c
+++ b/sys/opencrypto/cryptodev.c
@@ -823,7 +823,6 @@
if (crp->crp_etype == EAGAIN) {
crp->crp_etype = 0;
- crp->crp_flags &= ~CRYPTO_F_DONE;
cod->done = false;
goto again;
}
@@ -1026,7 +1025,6 @@
if (crp->crp_etype == EAGAIN) {
crp->crp_etype = 0;
- crp->crp_flags &= ~CRYPTO_F_DONE;
cod->done = false;
goto again;
}
diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c
--- a/sys/opencrypto/ktls_ocf.c
+++ b/sys/opencrypto/ktls_ocf.c
@@ -224,7 +224,6 @@
}
crp->crp_etype = 0;
- crp->crp_flags &= ~CRYPTO_F_DONE;
oo.done = false;
counter_u64_add(ocf_retries, 1);
}
@@ -240,7 +239,6 @@
state = crp->crp_opaque;
if (crp->crp_etype == EAGAIN) {
crp->crp_etype = 0;
- crp->crp_flags &= ~CRYPTO_F_DONE;
counter_u64_add(ocf_retries, 1);
error = crypto_dispatch(crp);
if (error != 0) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 2, 3:13 PM (17 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17907221
Default Alt Text
D50104.diff (4 KB)
Attached To
Mode
D50104: crypto: Remove most uses of CRYPTO_F_DONE
Attached
Detach File
Event Timeline
Log In to Comment