resolve_btfids: Don't list -EBUSY next to -EINPROGRESS

crypto_enqueue_request() returns three codes. Only -ENOSPC is a failure:

	int err = -EINPROGRESS;

	if (unlikely(queue->qlen >= queue->max_qlen)) {
		if (!(request->flags & CRYPTO_TFM_REQ_MAY_BACKLOG)) {
			err = -ENOSPC;
			goto out;
		}
		err = -EBUSY;
		..
	}
	queue->qlen++;
	list_add_tail(&request->list, &queue->list);
out:
	return err;

-EBUSY says that the request is queued on the backlog. crypto_wait_req()
waits for the completion after -EINPROGRESS and after -EBUSY. The tag of
the function is 'bpf_fmodret_retval:-28,-16'. An fmod_ret program that
returns -EBUSY skips the list_add_tail(). The caller then waits for
a completion that never comes.

means_failure() cannot drop -EBUSY for all functions. In most of them it
is a plain failure. In an x86-64 GCC build 645 of the 11432 tagged
functions list it, and it is the only error of 205 of them.

ccp_enqueue_cmd() and qat_alg_send_message_maybacklog() have such
a backlog too. All three functions also return -EINPROGRESS. The rule:

	-EBUSY is not in the list if the function returns -EINPROGRESS too.

crypto_enqueue_request() stays a target with -ENOSPC.

	                list -EBUSY     lose it
	x86-64 GCC      645 of 11432    1
	x86-64 clang    674 of 12096    2
	arm64 clang     638 of 10954    2

No function loses its tag. The second function is seccomp_notify_ioctl().
Clang inlines seccomp_notify_addfd() there. Its -EBUSY is a plain failure
next to an -EINPROGRESS of another kind. It keeps five other errors.

Fixes: 4dd950adacad ("resolve_btfids: Tag the functions that return errors")
Reported-by: David Windsor <dwindsor@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261114232754.2732901-1-alexei.starovoitov@gmail.com
Closes: https://lore.kernel.org/bpf/CAEXv5_i17dJmGp3y_0U_f_xK9-SyC9M4GkLCx=pT=4VoXJ4abg@mail.gmail.com/
3 files changed