diff options
| author | Yi Kuo <yi@yikuo.dev> | 2026-04-29 13:00:11 +0300 |
|---|---|---|
| committer | Steve French <stfrench@microsoft.com> | 2026-05-02 00:24:29 +0300 |
| commit | 9900b9fee5a0e0f72d7c744b37c7c851d5785ac6 (patch) | |
| tree | f93cd07cea2a54259c302ad86582f9fed7fcb025 /include/linux/timerqueue.h | |
| parent | e768103cfbac30a49860aca08a7710d39dbdd470 (diff) | |
| download | linux-9900b9fee5a0e0f72d7c744b37c7c851d5785ac6.tar.xz | |
smb: smbdirect: fix MR registration for coalesced SG lists
ib_dma_map_sg() modifies the provided scatterlist and returns the
number of mapped entries, which can be fewer than the requested
mr->sgt.nents if the DMA controller coalesces contiguous memory
segments. Passing the original, uncoalesced count to ib_map_mr_sg()
causes memory registration failures if coalescing actually occurs.
Capture the actual mapped count returned by ib_dma_map_sg() and pass it
to ib_map_mr_sg() to ensure correct MR registration.
Also update the ib_dma_map_sg() error logging to drop the error
pointer formatting, since the return value is an integer count
rather than an error code.
Ensure a proper error code (-EIO) is assigned when DMA mapping or
MR registration fails.
Fixes: de5ef8ec3c46 ("smb: smbdirect: introduce smbdirect_mr.c with client mr code")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221408
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Yi Kuo <yi@yikuo.dev>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions
