🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #11546

Re: [PATCH] net/smc: deregister the MR when SG mapping fails

#11546
From: Dust Li
Date: Thu, 05 Nov 2026 08:54
40 lines
9576 bytes
On 2026-11-04 02:28:12, Wentao Liang wrote:
>When smc_ib_map_mr_sg() maps fewer entries than the SG table holds,
>smc_ib_get_memory_region() returns -EINVAL with the memory region
>still allocated and its pointer left in buf_slot->mr[link_idx].
>The caller only undoes the DMA mapping and frees the SG table, and
>because buf_desc->is_map_ib[] is set only after this function
>succeeds, smcr_buf_unmap_link() later skips the buffer.  Both the
>MR and the pd->usecnt reference taken by ib_alloc_mr() are lost.
>
>The stale pointer is also harmful: a retry takes the "already done"
>shortcut and treats a memory region that was never mapped as valid.
>
>Deregister the memory region and clear the slot before returning.
>
>Fixes: 897e1c245773 ("net/smc: use separate memory regions for RMBs")
>Cc: stable@vger.kernel.org
>Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
>Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>

For the patch itself,

Reviewed-by: Dust Li <dust.li@linux.alibaba.com>


But checkpatch.pl failed with the following errors:

WARNING: Non-standard signature: Assisted-by:
#66:
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex

ERROR: Unrecognized email address: 'DeepSeek-V4.1-Flash and OpenAI
Codex'
#66:
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex

total: 1 errors, 1 warnings, 0 checks, 12 lines checked

Best regards,
Dust
Technical Details
Message-ID: <auxEVwAk8Zu4j3w9@linux.alibaba.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357152-linux-kernel-netdev=dewy.ru
References: <20261104022812.1484233-1-vulab@iscas.ac.cn>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357152-linux-kernel-netdev=dewy.ru
From: dust.li@linux.alibaba.com (Dust Li)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] net/smc: deregister the MR when SG mapping fails
Date: Thu, 5 Nov 2026 16:54:47 +0800
Organization: Usenet Network
Message-ID: <auxEVwAk8Zu4j3w9@linux.alibaba.com>
References: <20261104022812.1484233-1-vulab@iscas.ac.cn>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="3596325"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:3xc14GmN0DPcnqAdzglw6cH4cO4= sha256:XRRS/iwhw7seORrQsOtd0sJ1yvvj8GgNgJf8uXwjuDs=
	sha1:phyRD0jmixFzlXTARy1i2PgQkR0= sha256:jR8iDE6la5EE4UB79UJ2YXsOtICsXhuxGtCWRziYeck=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id B67B7112ED7; Thu,  5 Nov 2026 11:55:52 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -10.65
X-Spam-Status: No, score=-10.65 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	UNPARSEABLE_RELAY=0.001, USER_IN_DEF_DKIM_WL=-7.5]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=linux.alibaba.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id BkDI8I_hYiPk;
	Thu,  5 Nov 2026 11:55:45 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-357152-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id BCBB0112E1E; Thu,  5 Nov 2026 11:55:34 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 0BC94605BFF; Thu,  5 Nov 2026 08:55:15 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793868907;
	b=ukfK7JxWfJ88OHL3vdC1qVyQ7mM9L+l98GSv0nmaPFosWskwvqTDMcz76EfypOMY9cvk
	 nWQxVL/PosARNvYGrHT1V3tp++joZP8sJpRzSsLakJE3NlNNyIVbF0tGRnqLqhFP69TNQ
	 9zehw/6l5tbBY7tD0CJoJchWNo/7C0BNg+BgBNn2AgzAynowrQ/jF9sD8hzK57Pi9vRwT
	 SNCCrXf/Y/6ksOfd3UV/13Z+cmLjleezExoPlZS9i5JyytJWE2o16Lwr2D06xlpPkdLRc
	 T6l6XbpMfFbmL+hF6ol97bo22v4xNE/YQPS/4HDmOZ3JpqeXPvV91S5OtZfp9tiDAxQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793868907;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:
	 X-Alimail-AntiSpam:Received:Date:From:To:Cc:Subject:Message-ID:
	 Reply-To:References:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To;
	bh=tLitCl0VEuwGphljrXsGB+0zDpgukEGa28T33owqfkw=;
	b=0THF9h41iDrFa278CSHWVV447+dEh3ISmFqY4efsfA8acrW9Gbw+qwq+6+gpZsdiOESD
	 jYwecdoGnvA2KIXyY28ewVyUml9L/NbnzN0Yx/yKv1/lCn9VybRo6kUo9LevZTPbprc7G
	 ajFyytEPJDiTCiq2XU9boROY+rla4ZNhVsGu+QKbNeFurcrz3yG3NfFtUUaCwQEwaFn+F
	 Gli6PY/DCXqlxzXVN6yIHXu9Q2jcY08+s1pQMhjB1xwK598BJ5HZb7hEvmGTBXj9Ta04z
	 3Fc6GYcwGXgQmwUK45JcQQNB6WLcx1PSKQtbIF4DoN9tqL14pf70GVAjUWaWBtWyhPQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=rhTDPCjR;
	dmarc=pass header.from=linux.alibaba.com;
	spf=pass smtp.mailfrom=linux.alibaba.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 47AF1606A329;
	Thu,  5 Nov 2026 08:55:07 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=rhTDPCjR
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.30.100
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793868901;
	b=FhP0yLEp251+gx4yTUOtJdE4BGgDTHpKA9XYzNivIy8m7kf5IJp8vKlN4Cb5eklUylGy
	 djTNv+cJLDU3Z7xzf9SRr3s/puX98ji4i2Wh0asmTLJeSYESCFpc4vQuAflRGE4R+sUeh
	 gvlpoGEZTzCPIjYWwyIQWHRqQLZkpPT/EzqVt+Ax3aY51AOFR2c/k1ryAcwromgbPbCUJ
	 FMVe6yal9JVzzKBArm2SN2SmK2WtZt3Z2M9uT4UyCkXSZo+nLfc0HRmfekTRtAZv19kWK
	 HncZroXQBGnWDlsM2qkf+1tu4/hQv5HS6lVrr+rsgidVs9AP9hZI+02w3X9DpzMlxow==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793868901;
	h=DMARC-Filter:DKIM-Signature:X-Alimail-AntiSpam:Received:Date:From:To:
	 Cc:Subject:Message-ID:Reply-To:References:MIME-Version:Content-Type:
	 Content-Disposition:In-Reply-To;
	bh=tLitCl0VEuwGphljrXsGB+0zDpgukEGa28T33owqfkw=;
	b=FnpauW+LIB8s0MfqeEr/kgsWhMS6+9Ez1yOsFXw350LQ/g8+ovxnR1HTwmiRr2b3x2Xc
	 9sOGub7THqeqMHVdnvphPHltvmVQZJWjrlozLm/1YaClib+m8oU/07zU6werTcbhi5OLd
	 IhvnGxwT/9wruYzWztim2ynVlfxcf32UrRYsa75W4dnhRzerm/pbOBzhd5MfGHQz7/u3o
	 2CZv7WjD3bdhQcWTIcbU7tAfhE/37FpGJ9ueXbx5Am2rP6aIfDCBVWErADXTn6014+Zf+
	 1NoLIeeIUzZIRhXQ/R+a8HhtLMvZPr2Tv8t7LLUsGyrRXilJbLehAfWqvWZRlsm5W/A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.alibaba.com;
	spf=pass smtp.mailfrom=linux.alibaba.com;
	arc=none smtp.remote-ip=115.124.30.100
X-Received: from out30-100.freemail.mail.aliyun.com (out30-100.freemail.mail.aliyun.com [115.124.30.100])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 584EC606A32C;
	Thu,  5 Nov 2026 08:54:52 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 584EC606A32C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=linux.alibaba.com; s=default;
	t=1793868889; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type;
	bh=tLitCl0VEuwGphljrXsGB+0zDpgukEGa28T33owqfkw=;
	b=rhTDPCjRrM3oFa6imoMwt9ywyUXlQpncO5M1hNrLspTO6M0AmcB47wOCzMakNu44FLfE244xLhdGfbA9+sXUi23sRoLkyNWfvtCBimbXLeB4scQn/SRFYC+KWupaDcTDVxKvkhnS4/q9JtbF37oAM7axilUDkqkExsi8x0Scu08=
X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R371e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037033178;MF=dust.li@linux.alibaba.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---0XE86VIg_1793868888;
X-Received: from localhost(mailfrom:dust.li@linux.alibaba.com fp:SMTPD_---0XE86VIg_1793868888 cluster:ay36)
          by smtp.aliyun-inc.com;
          Thu, 05 Nov 2026 16:54:48 +0800
X-Cc: linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org,
	netdev@vger.kernel.org
X-Reply-To: dust.li@linux.alibaba.com
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261104022812.1484233-1-vulab@iscas.ac.cn>