From: Stefan Metzmacher <metze@samba.org>
To: Steve French <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>, Long Li <longli@microsoft.com>,
Namjae Jeon <linkinjeon@kernel.org>,
linux-cifs@vger.kernel.org, samba-technical@lists.samba.org
Subject: Re: [PATCH 10/10] smb: client: let destroy_mr_list() keep smbdirect_mr_io memory if registered
Date: Wed, 15 Oct 2025 09:20:56 +0200 [thread overview]
Message-ID: <7af986c8-7050-4b51-962e-dc3984ee1f58@samba.org> (raw)
In-Reply-To: <6d275bab3ee66cf653c9e1e242a0a87efa352063.1760295528.git.metze@samba.org>
Hi Steve,
as already discussed, one additional hunk is needed...
> @@ -2402,6 +2448,9 @@ static int allocate_mr_list(struct smbdirect_socket *sc)
> goto kzalloc_mr_failed;
> }
>
> + kref_init(&mr->kref);
> + mutex_init(&mr->mutex);
> +
> mr->mr = ib_alloc_mr(sc->ib.pd,
> sc->mr_io.type,
> sp->max_frmr_depth);
Here we're missing the following hunk:
@@ -2483,6 +2483,7 @@ static int allocate_mr_list(struct smbdirect_socket *sc)
kcalloc_sgl_failed:
ib_dereg_mr(mr->mr);
ib_alloc_mr_failed:
+ mutex_destroy(&mr->mutex);
kfree(mr);
kzalloc_mr_failed:
destroy_mr_list(sc);
I fixed it in my for-6.18/fs-smb-20251015-v2 branch,
up to commit e4418cd1d5d80a8c24530ac0a41a5451c44f82bf.
git fetch https://git.samba.org/metze/linux/wip.git for-6.18/fs-smb-20251015-v2
The above hunk is the only difference to the current sfrench-cifs-2.6/for-next
(at commit 7949ce089965bd025a8d46dbaa2f5d0a2bd4ec77), I only moved my commits
to the top. So you can just replace 7949ce089965bd025a8d46dbaa2f5d0a2bd4ec77 by
e4418cd1d5d80a8c24530ac0a41a5451c44f82bf.
Thanks!
metze
next prev parent reply other threads:[~2025-10-15 7:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-12 19:10 [PATCH 00/10] improve smbdirect_mr_io lifetime Stefan Metzmacher
2025-10-12 19:10 ` [PATCH 01/10] smb: smbdirect: introduce smbdirect_mr_io.{kref,mutex} and SMBDIRECT_MR_DISABLED Stefan Metzmacher
2025-10-12 19:10 ` [PATCH 02/10] smb: client: change smbd_deregister_mr() to return void Stefan Metzmacher
2025-10-12 19:10 ` [PATCH 03/10] smb: client: let destroy_mr_list() call list_del(&mr->list) Stefan Metzmacher
2025-10-12 19:10 ` [PATCH 04/10] smb: client: let destroy_mr_list() remove locked from the list Stefan Metzmacher
2025-10-12 19:10 ` [PATCH 05/10] smb: client: improve logic in allocate_mr_list() Stefan Metzmacher
2025-10-12 19:10 ` [PATCH 06/10] smb: client: improve logic in smbd_register_mr() Stefan Metzmacher
2025-10-12 19:10 ` [PATCH 07/10] smb: client: improve logic in smbd_deregister_mr() Stefan Metzmacher
2025-10-12 19:10 ` [PATCH 08/10] smb: client: call ib_dma_unmap_sg if mr->sgt.nents is not 0 Stefan Metzmacher
2025-10-12 19:10 ` [PATCH 09/10] smb: client: let destroy_mr_list() call ib_dereg_mr() before ib_dma_unmap_sg() Stefan Metzmacher
2025-10-12 19:10 ` [PATCH 10/10] smb: client: let destroy_mr_list() keep smbdirect_mr_io memory if registered Stefan Metzmacher
2025-10-15 7:20 ` Stefan Metzmacher [this message]
2025-10-15 12:47 ` Steve French
2025-10-13 3:05 ` [PATCH 00/10] improve smbdirect_mr_io lifetime Steve French
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=7af986c8-7050-4b51-962e-dc3984ee1f58@samba.org \
--to=metze@samba.org \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=samba-technical@lists.samba.org \
--cc=smfrench@gmail.com \
--cc=tom@talpey.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).