mirror of
https://github.com/torvalds/linux.git
synced 2026-03-13 22:36:17 +01:00
smb: client: let destroy_mr_list() call ib_dereg_mr() before ib_dma_unmap_sg()
This is more consistent as we call ib_dma_unmap_sg() only
when the memory is no longer registered.
This is the same pattern as calling ib_dma_unmap_sg() after
IB_WR_LOCAL_INV.
Fixes: c739858334 ("CIFS: SMBD: Implement RDMA memory registration")
Cc: Steve French <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Long Li <longli@microsoft.com>
Cc: Namjae Jeon <linkinjeon@kernel.org>
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
b9c0becc2f
commit
1ef0e16c3d
1 changed files with 2 additions and 1 deletions
|
|
@ -2365,9 +2365,10 @@ static void destroy_mr_list(struct smbdirect_socket *sc)
|
|||
spin_unlock_irqrestore(&sc->mr_io.all.lock, flags);
|
||||
|
||||
list_for_each_entry_safe(mr, tmp, &all_list, list) {
|
||||
if (mr->mr)
|
||||
ib_dereg_mr(mr->mr);
|
||||
if (mr->sgt.nents)
|
||||
ib_dma_unmap_sg(sc->ib.dev, mr->sgt.sgl, mr->sgt.nents, mr->dir);
|
||||
ib_dereg_mr(mr->mr);
|
||||
kfree(mr->sgt.sgl);
|
||||
list_del(&mr->list);
|
||||
kfree(mr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue