From patchwork Fri Jan 5 17:05:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 185469 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp6347217dyb; Fri, 5 Jan 2024 09:06:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzYRy9EcWgIkH9QkpqYApUdgPZZ13uXPpGrOkKsFzv+frLXAxkcBmNr7bBj1p8qfry2Lvu X-Received: by 2002:a17:902:e842:b0:1d4:39d5:8edc with SMTP id t2-20020a170902e84200b001d439d58edcmr2572473plg.41.1704474369876; Fri, 05 Jan 2024 09:06:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704474369; cv=none; d=google.com; s=arc-20160816; b=oZLCXN4d0Z6Cwu8/5CNNQ2Ay+JQOapTkQUke9VjDNh0GJbFGLz7wYPPCr58hjRmiBS OoR0UPtgNPYXKpStF6ZPMxx0sbF4q03FMCyFQyUHeTPCC6CnafT7aQmmAnSckomyO0oU uHQTG7oCpFlRKXyk0P6fp4hD2hMnEoHlD9mmjv1JV1QMKl/+5H0xdVbihE+0BweQXRwT AKV2PvGVjdcRIjj3JTx4d+fKpqk3dwUArsYPzNj6XraQY6eHfcPQTmpM5RWM/8mC5Cn4 Pp76dAZ8lEC/uif4kiXM/LwjnueeBGgmKfSf89jyrcyQ0fQWgKWlHkrKaAFlypbsVEJr UY8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:content-transfer-encoding:content-id:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:cc:to :from:organization:dkim-signature; bh=JrHpstWMweqHmwv0W0gV2LfaiN8+NJubK8GIKuda4w4=; fh=ZtXT4EhCVz8l2Yug/IC9dCH+r5a0SWpJM+worp9SNdU=; b=de8AXAzNRQuHPFxLagC4Y+EPkR0Njw7R3kvhbzAI5qY/qxqL0lJbvZrLo5ryKhSGSd PAMs5FGdODqPSj8QrkvMbOHc1dyl4/stc+UDe+MxkrBd/wh86LVrLrEEaAMv1GlmX4hj +wWioD7nofXN/xnFt64Smxcjyd7LaSUWNqT4shtstdZOWh0q8XmNxNGuuyNahWhtCWnl jdvIxY6fgh5vNOvIVDwQheq9Q/XQ5ca+7++dluWrMnpyHx9UWMTsksOPox+q0zfAquMG 8KGFP+uWnNupkihCUtAVhDMab37Bqb2t1vMpfKZkeGRs7posHyx1r4+ccjvkpZLjF3fB 3cIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PGGoYXkw; spf=pass (google.com: domain of linux-kernel+bounces-18095-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18095-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p15-20020a170902e74f00b001d3e0015960si1522390plf.143.2024.01.05.09.06.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 09:06:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18095-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PGGoYXkw; spf=pass (google.com: domain of linux-kernel+bounces-18095-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18095-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 80508284641 for ; Fri, 5 Jan 2024 17:06:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5BB3A321B7; Fri, 5 Jan 2024 17:05:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PGGoYXkw" X-Original-To: linux-kernel@vger.kernel.org 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 2E34331A81 for ; Fri, 5 Jan 2024 17:05:49 +0000 (UTC) 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704474349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JrHpstWMweqHmwv0W0gV2LfaiN8+NJubK8GIKuda4w4=; b=PGGoYXkwb0ZXLQupzQiPV/Lw0atNVwO4pkXUxFytBUe8hNoSHo0PtW6TPh81+8P9uOCi42 riPNDok9Qo+B2AWlSUAODBkLZIeqt7tepNsZyWQxi6KqXW+XOFkZp42MNRkk5PmKv378yi WjqarMyZISgbqOtMqBGu4OmMN+zOsFM= 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-549-qnNTMjryOLCldvCVxbsb-g-1; Fri, 05 Jan 2024 12:05:43 -0500 X-MC-Unique: qnNTMjryOLCldvCVxbsb-g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 401B81C05148; Fri, 5 Jan 2024 17:05:43 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1A5253C25; Fri, 5 Jan 2024 17:05:41 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells To: Marc Dionne cc: dhowells@redhat.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-afs@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rxrpc: Fix skbuff cleanup of call's recvmsg_queue and rx_oos_queue Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-ID: <1366724.1704474341.1@warthog.procyon.org.uk> Date: Fri, 05 Jan 2024 17:05:41 +0000 Message-ID: <1366725.1704474341@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787270916637266159 X-GMAIL-MSGID: 1787270916637266159 Fix rxrpc_cleanup_ring() to use rxrpc_purge_queue() rather than skb_queue_purge() so that the count of outstanding skbuffs is correctly updated when a failed call is cleaned up. Without this rmmod may hang waiting for rxrpc_n_rx_skbs to become zero. Reported-by: Marc Dionne Signed-off-by: David Howells 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/call_object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/rxrpc/call_object.c b/net/rxrpc/call_object.c index 773eecd1e979..f10b37c14772 100644 --- a/net/rxrpc/call_object.c +++ b/net/rxrpc/call_object.c @@ -545,8 +545,8 @@ void rxrpc_get_call(struct rxrpc_call *call, enum rxrpc_call_trace why) */ static void rxrpc_cleanup_ring(struct rxrpc_call *call) { - skb_queue_purge(&call->recvmsg_queue); - skb_queue_purge(&call->rx_oos_queue); + rxrpc_purge_queue(&call->recvmsg_queue); + rxrpc_purge_queue(&call->rx_oos_queue); } /*