From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70DF448A2BE for ; Mon, 7 Sep 2026 11:38:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788781091; cv=none; b=oVGdGg6AgKjYKlP9hMMHu63YuqwtHDfuCZ7XvoVI3wz9azJarwPBLihbs6ADPPDD8PAdOUzSLKThHC/Kray8gfkISAA+c/UzlpE45Noh6JdjWBhxG8/8TtUzttIM8HhIafEolQowWbFYVUY/6lB+FkO6hzVMeonVuGB6kIZzZok= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788781091; c=relaxed/simple; bh=tfEoOqUUY5uPobZJkXgbLqSu5IFOc+FoE1/vAmlcrmI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BRKijtkLDRx9mu1+7xhmCcF6ubCC5ij0v2AU4NVT3d8oGj/9Ve7h7tSKBDBgPqDpayhT2iklMnJr3pjuNigR+LwypRPsyZMBNn/+lb+M2Dmy5n28WkOVDOzzT6OQKo3697v5tXDVEOw3q6Jm9VBWcByIPaNJ5wEiLTXp+DtvMsU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=X8ng6K/K; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="X8ng6K/K" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788781088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9luXgLKX7odCzaclov5u6jsmNvxKtHBsHpUJ1lHcupg=; b=X8ng6K/K+xJ1w5A0st/XpBzRPJqqvypYObIjrz/pssKKA5VX0uDodaBgW+1uw191lG2Pox 3jISOGk1HI/UHqX8SObBPOP+SNrNmHPhs6qRXsLV12M+xNcNV441RzPqD9XF72VMkLQB8T zLFetapO+BsqP75mBWnhBy8pA/+AyJ0= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-482-_Pc-tk2OPKW0ga5iJG1FHA-1; Mon, 07 Sep 2026 07:38:05 -0400 X-MC-Unique: _Pc-tk2OPKW0ga5iJG1FHA-1 X-Mimecast-MFC-AGG-ID: _Pc-tk2OPKW0ga5iJG1FHA_1788781083 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6FA6D1802162; Mon, 7 Sep 2026 11:38:03 +0000 (UTC) Received: from warthog.com (unknown [10.44.32.158]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D25F81956042; Mon, 7 Sep 2026 11:37:59 +0000 (UTC) From: David Howells To: netdev@vger.kernel.org Cc: David Howells , Marc Dionne , Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH net v9 02/14] afs: Fix afs to abort the rxrpc call on send error Date: Mon, 7 Sep 2026 12:37:29 +0100 Message-ID: <20260907113743.1453210-3-dhowells@redhat.com> In-Reply-To: <20260907113743.1453210-1-dhowells@redhat.com> References: <20260907113743.1453210-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Fix afs_send_empty_reply() and afs_send_simple_reply() to always try to abort the rxrpc call rather than just aborting on -ENOMEM and otherwise abandoning it. If the call is already complete due to network failure or a received abort, this will do nothing. Also make afs_make_call() always abort on send error; again, it does nothing if the rxrpc call is already dead. Fixes: 08e0e7c82eea ("[AF_RXRPC]: Make the in-kernel AFS filesystem use AF_RXRPC.") Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260824091645.415423-1-dhowells%40redhat.com Signed-off-by: David Howells cc: Marc Dionne cc: Eric Dumazet cc: "David S. Miller" cc: Jakub Kicinski cc: Paolo Abeni cc: Simon Horman cc: linux-afs@lists.infradead.org cc: stable@vger.kernel.org --- fs/afs/rxrpc.c | 35 +++++++++++------------------------ include/trace/events/rxrpc.h | 2 +- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c index a80b043d36be..04756d8744e2 100644 --- a/fs/afs/rxrpc.c +++ b/fs/afs/rxrpc.c @@ -449,10 +449,8 @@ void afs_make_call(struct afs_call *call, gfp_t gfp) return; error_do_abort: - if (ret != -ECONNABORTED) - rxrpc_kernel_abort_call(call->net->socket, rxcall, - RX_USER_ABORT, ret, - afs_abort_send_data_error); + rxrpc_kernel_abort_call(call->net->socket, rxcall, + RX_USER_ABORT, ret, afs_abort_send_data_error); if (call->async) { afs_see_call(call, afs_call_trace_async_abort); return; @@ -865,6 +863,7 @@ void afs_send_empty_reply(struct afs_call *call) { struct afs_net *net = call->net; struct msghdr msg; + int ret; _enter(""); @@ -877,22 +876,13 @@ void afs_send_empty_reply(struct afs_call *call) msg.msg_controllen = 0; msg.msg_flags = 0; - switch (rxrpc_kernel_send_data(net->socket, call->rxcall, &msg, 0, - afs_notify_end_reply_tx)) { - case 0: - _leave(" [replied]"); + ret = rxrpc_kernel_send_data(net->socket, call->rxcall, &msg, 0, + afs_notify_end_reply_tx); + if (ret >= 0) return; - case -ENOMEM: - _debug("oom"); - rxrpc_kernel_abort_call(net->socket, call->rxcall, - RXGEN_SS_MARSHAL, -ENOMEM, - afs_abort_oom); - fallthrough; - default: - _leave(" [error]"); - return; - } + rxrpc_kernel_abort_call(net->socket, call->rxcall, + RXGEN_SS_MARSHAL, ret, afs_abort_send_error); } /* @@ -930,12 +920,9 @@ void afs_send_simple_reply(struct afs_call *call, const void *buf, size_t len) return; } - if (n == -ENOMEM) { - _debug("oom"); - rxrpc_kernel_abort_call(net->socket, call->rxcall, - RXGEN_SS_MARSHAL, -ENOMEM, - afs_abort_oom); - } + + rxrpc_kernel_abort_call(net->socket, call->rxcall, + RXGEN_SS_MARSHAL, n, afs_abort_send_error); _leave(" [error]"); } diff --git a/include/trace/events/rxrpc.h b/include/trace/events/rxrpc.h index 704a10de6670..554dfb777b93 100644 --- a/include/trace/events/rxrpc.h +++ b/include/trace/events/rxrpc.h @@ -20,10 +20,10 @@ /* AFS errors */ \ EM(afs_abort_general_error, "afs-error") \ EM(afs_abort_interrupted, "afs-intr") \ - EM(afs_abort_oom, "afs-oom") \ EM(afs_abort_op_not_supported, "afs-op-notsupp") \ EM(afs_abort_probeuuid_negative, "afs-probeuuid-neg") \ EM(afs_abort_send_data_error, "afs-send-data") \ + EM(afs_abort_send_error, "afs-send-error") \ EM(afs_abort_unmarshal_error, "afs-unmarshal") \ EM(afs_abort_unsupported_sec_class, "afs-unsup-sec-class") \ /* rxperf errors */ \