From nobody Sun Feb 8 12:39:14 2026 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 CD6F4482CD for ; Tue, 12 Mar 2024 23:37:35 +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=1710286657; cv=none; b=UViR0UP3Jtpk/6oH2WApW7hZ4huR+cVpuG7MLYRlYrTDmpU0doris1/tPGRwxEc+a6pC66OjDj0llB43LjJkmtXbS48fZH2bE6JKCQqYaycA5eibll1MC+XnyZaGedXM3Wjl24mpMUELwyZGgGSm/115YVxK/skqBeXhB+LYSsc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710286657; c=relaxed/simple; bh=yTIXu/sKqhCcK9sGsntr53/cH4qNlYidw+7xA1m4oXk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RR1+dUmPozS3i9OibuOSUWndZXyrvYLZFmODLdJAkIJ9nIfYw258vsTnZx13467+lycjyGOex+mnMWTvUxlgWtEY/9mou/Cqlhb8RMMZ9H1cazbCdspPYZ3rgmC7Do7bOwcgYjDKflAnJZZDFEgs80Yz3yQPvCoxrgYDuuecA7g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=YY2GEu+V; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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="YY2GEu+V" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710286654; 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=xOZDJSFUKIYqUSyAe6A//0kKA0XOQ3CbpICjDSiEJvc=; b=YY2GEu+VIpQuFhkKIMYM1fRnLtQnyZQeH/6HlkIHdg0Vdvkt57y1aUeYwfKh5vb+Kyak5m iSlC0n3mD9khL4m4bzFaxnDsHIHYTup+599FI5SNMcERlimSB6ozpXP/qKUEzr5ls3JdnN 0cofTMhKE0HlBtgkEJu33OP5Ij6B4nU= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-586-knBeSS_CMTGWUtT_AjoIhg-1; Tue, 12 Mar 2024 19:37:31 -0400 X-MC-Unique: knBeSS_CMTGWUtT_AjoIhg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id ED29C38035A6; Tue, 12 Mar 2024 23:37:30 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49E0A2166BB6; Tue, 12 Mar 2024 23:37:29 +0000 (UTC) From: David Howells To: netdev@vger.kernel.org Cc: David Howells , Marc Dionne , Yunsheng Lin , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org, Alexander Duyck , "Michael S . Tsirkin" Subject: [PATCH net-next 1/2] rxrpc: Fix use of changed alignment param to page_frag_alloc_align() Date: Tue, 12 Mar 2024 23:37:17 +0000 Message-ID: <20240312233723.2984928-2-dhowells@redhat.com> In-Reply-To: <20240312233723.2984928-1-dhowells@redhat.com> References: <20240312233723.2984928-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: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 Content-Type: text/plain; charset="utf-8" Commit 411c5f36805c ("mm/page_alloc: modify page_frag_alloc_align() to accept align as an argument") changed the way page_frag_alloc_align() worked, but it didn't fix AF_RXRPC as that use of that allocator function hadn't been merged yet at the time. Now, when the AFS filesystem is used, this results in: WARNING: CPU: 4 PID: 379 at include/linux/gfp.h:323 rxrpc_alloc_data_txbu= f+0x9d/0x2b0 [rxrpc] Fix this by using __page_frag_alloc_align() instead. Note that it might be better to use an order-based alignment rather than a mask-based alignment. Fixes: 49489bb03a50 ("rxrpc: Do zerocopy using MSG_SPLICE_PAGES and page fr= ags") Signed-off-by: David Howells Reported-by: Marc Dionne cc: Yunsheng Lin cc: Alexander Duyck cc: Michael S. Tsirkin cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: linux-afs@lists.infradead.org cc: netdev@vger.kernel.org --- net/rxrpc/txbuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/rxrpc/txbuf.c b/net/rxrpc/txbuf.c index b2a82ab756c2..e0679658d9de 100644 --- a/net/rxrpc/txbuf.c +++ b/net/rxrpc/txbuf.c @@ -33,8 +33,8 @@ struct rxrpc_txbuf *rxrpc_alloc_data_txbuf(struct rxrpc_c= all *call, size_t data_ total =3D hoff + sizeof(*whdr) + data_size; =20 mutex_lock(&call->conn->tx_data_alloc_lock); - buf =3D page_frag_alloc_align(&call->conn->tx_data_alloc, total, gfp, - ~(data_align - 1) & ~(L1_CACHE_BYTES - 1)); + buf =3D __page_frag_alloc_align(&call->conn->tx_data_alloc, total, gfp, + ~(data_align - 1) & ~(L1_CACHE_BYTES - 1)); mutex_unlock(&call->conn->tx_data_alloc_lock); if (!buf) { kfree(txb); From nobody Sun Feb 8 12:39:14 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 C28C050A6C for ; Tue, 12 Mar 2024 23:37:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710286660; cv=none; b=qUxTwO53HPCKx6GakDyp8AgBcY55y7cKziK+3VGbp5JfCtD46dtUpXPUZ802rkIdOP0DaeHTWqGex5T+r1xUNxVbXBB13bbCE7fMeqz060uCLNgeqYyX4Qb3JfzzhNq2KwFgpjruAWJJMDFYWzuEK88lNtjp9vDLdY92ri0fsUQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710286660; c=relaxed/simple; bh=w8JCsLSjSA3OkQoV28nEFem36dFCa/7sa9d7M6Kmb8g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LwynpUz6BCg3Ek5zrlCVfOJnwe5s3cYCUPJIdIbGakWtNkKab8UMHDZl+R5+aaILWXF7Dx/tGkiN/FgB+wE/pV2hpeeoXqt7Or4/vyrbmx3I7cBHFnHQH4NnvwI+XaNbpBolOakpAqhHyYJpguzau1Hqqk9YsgTU6ZzMFyJlv0M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=gCWQxzBK; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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="gCWQxzBK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710286657; 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=9OX7Txmvz9CCuXto10fOD2XvYnGo3IOMbl07Vyopd3Y=; b=gCWQxzBK4bjeQgt9MWyK4JBIE1EQAvzHDs8/43eD5Zo0mUByPq1u25EdEBBRLy3kyt8fu4 RnPpGw7FwiSyCACzv+OMnZn++7M6KhsRiIz1VCP7dwTCcb9N9nVDTyjRFo+obZ3cTP2vFk +g7DWRTnS656So4mrS+5FHicucxrphk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-343-uMavIwFdNDGV7jNNc5g8HA-1; Tue, 12 Mar 2024 19:37:33 -0400 X-MC-Unique: uMavIwFdNDGV7jNNc5g8HA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4527101A552; Tue, 12 Mar 2024 23:37:32 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C54F10F53; Tue, 12 Mar 2024 23:37:31 +0000 (UTC) From: David Howells To: netdev@vger.kernel.org Cc: David Howells , Marc Dionne , Yunsheng Lin , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/2] rxrpc: Fix error check on ->alloc_txbuf() Date: Tue, 12 Mar 2024 23:37:18 +0000 Message-ID: <20240312233723.2984928-3-dhowells@redhat.com> In-Reply-To: <20240312233723.2984928-1-dhowells@redhat.com> References: <20240312233723.2984928-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: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Content-Type: text/plain; charset="utf-8" rxrpc_alloc_*_txbuf() and ->alloc_txbuf() return NULL to indicate no memory, but rxrpc_send_data() uses IS_ERR(). Fix rxrpc_send_data() to check for NULL only and set -ENOMEM if it sees that. Fixes: 49489bb03a50 ("rxrpc: Do zerocopy using MSG_SPLICE_PAGES and page fr= ags") Signed-off-by: David Howells Reported-by: Marc Dionne cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: linux-afs@lists.infradead.org cc: netdev@vger.kernel.org --- net/rxrpc/sendmsg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c index 6f765768c49c..894b8fa68e5e 100644 --- a/net/rxrpc/sendmsg.c +++ b/net/rxrpc/sendmsg.c @@ -349,8 +349,8 @@ static int rxrpc_send_data(struct rxrpc_sock *rx, */ remain =3D more ? INT_MAX : msg_data_left(msg); txb =3D call->conn->security->alloc_txbuf(call, remain, sk->sk_allocati= on); - if (IS_ERR(txb)) { - ret =3D PTR_ERR(txb); + if (!txb) { + ret =3D -ENOMEM; goto maybe_error; } }