Netdev List
 help / color / mirror / Atom feed
From: Dust Li <dust.li@linux.alibaba.com>
To: Wentao Liang <vulab@iscas.ac.cn>,
	"D. Wythe" <alibuda@linux.alibaba.com>,
	Sidraya Jayagond <sidraya@linux.ibm.com>,
	Mahanta Jambigi <mjambigi@linux.ibm.com>,
	Tony Lu <tonylu@linux.alibaba.com>,
	Wen Gu <guwen@linux.alibaba.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>
Cc: linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH] net/smc: deregister the MR when SG mapping fails
Date: Thu, 5 Nov 2026 16:54:47 +0800	[thread overview]
Message-ID: <auxEVwAk8Zu4j3w9@linux.alibaba.com> (raw)
In-Reply-To: <20261104022812.1484233-1-vulab@iscas.ac.cn>

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


  parent reply	other threads:[~2026-11-05  8:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04  2:28 [PATCH] net/smc: deregister the MR when SG mapping fails Wentao Liang
2026-11-04  2:32 ` netdev-bot+sinfo
2026-11-05  8:54 ` Dust Li [this message]
2026-11-05  9:50 ` Mahanta Jambigi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=auxEVwAk8Zu4j3w9@linux.alibaba.com \
    --to=dust.li@linux.alibaba.com \
    --cc=alibuda@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=guwen@linux.alibaba.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mjambigi@linux.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sidraya@linux.ibm.com \
    --cc=tonylu@linux.alibaba.com \
    --cc=vulab@iscas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox