diff --git a/module/os/freebsd/spl/spl_taskq.c b/module/os/freebsd/spl/spl_taskq.c index e4b75f91b8fc..af32c0ee2e5c 100644 --- a/module/os/freebsd/spl/spl_taskq.c +++ b/module/os/freebsd/spl/spl_taskq.c @@ -357,7 +357,7 @@ taskq_cancel_id(taskq_t *tq, taskqid_t tid) taskq_ent_t *ent; if ((ent = taskq_lookup(tid)) == NULL) - return (0); + return (ENOENT); if (ent->tqent_type == NORMAL_TASK) { rc = taskqueue_cancel(tq->tq_queue, &ent->tqent_task, &pend); @@ -380,7 +380,7 @@ taskq_cancel_id(taskq_t *tq, taskqid_t tid) } /* Free the extra reference we added with taskq_lookup. */ taskq_free(ent); - return (rc); + return (pend ? 0 : ENOENT); } static void