nvme: Clear the notify flag if the consumer rejects the controller.

While here, fix some type mismatch warnings.

Reviewed by:	imp
Sponsored by:	Netapp, Inc.
Sponsored by:	Klara, Inc.
MFC after:	1 week
This commit is contained in:
Dag-Erling Smørgrav 2022-12-20 02:50:30 +01:00
parent 54b96380f5
commit 9a5acf365d
2 changed files with 5 additions and 3 deletions

View File

@ -177,8 +177,10 @@ nvme_notify(struct nvme_consumer *cons,
ctrlr->cons_cookie[cons->id] = ctrlr_cookie;
/* ctrlr_fn has failed. Nothing to notify here any more. */
if (ctrlr_cookie == NULL)
if (ctrlr_cookie == NULL) {
(void)atomic_cmpset_32(&ctrlr->notification_sent, 1, 0);
return;
}
if (ctrlr->is_failed) {
ctrlr->cons_cookie[cons->id] = NULL;

View File

@ -2052,7 +2052,7 @@ void nvme_resv_status_swapbytes(struct nvme_resv_status *s __unused,
size_t size __unused)
{
#if _BYTE_ORDER != _LITTLE_ENDIAN
u_int i, n;
size_t i, n;
s->gen = le32toh(s->gen);
n = (s->regctl[1] << 8) | s->regctl[0];
@ -2070,7 +2070,7 @@ void nvme_resv_status_ext_swapbytes(struct nvme_resv_status_ext *s __unused,
size_t size __unused)
{
#if _BYTE_ORDER != _LITTLE_ENDIAN
u_int i, n;
size_t i, n;
s->gen = le32toh(s->gen);
n = (s->regctl[1] << 8) | s->regctl[0];