Commit 4f91965
authored
DAOS-15847 object: restore iov_len for fetch on dup-only (no-merge) SGLs (#18413)
In obj_dup_sgls_free(), when ctx->alloc_bitmaps[i] == NULL, the function skips
the entire SGL with `continue`:
if (!ctx->alloc_bitmaps || !ctx->alloc_bitmaps[i])
continue;
This case arises when a SGL was duplicated only to strip iov_buf_len==0 entries
(skip_sgl_iov returned true) but no IOVs were merged into allocated buffers.
During construction (second pass of obj_sgls_dup), non-merged IOVs are copied as:
*iov_dup = *iov;
So iov_dup->iov_buf == iov->iov_buf (same pointer). The lower layer writes
fetch data into iov_dup->iov_buf and updates iov_dup->iov_len to reflect actual
bytes read.
Because obj_dup_sgls_free skips such SGLs, iov->iov_len in the *original* SGL
is never updated. After api_args->sgls is restored to orr_usgls, the caller sees
stale pre-fetch iov_len values even though the data is in the correct buffers.
Signed-off-by: Xuezhao Liu <xuezhao.liu@hpe.com>1 parent 2af3f8d commit 4f91965
1 file changed
Lines changed: 19 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4943 | 4943 | | |
4944 | 4944 | | |
4945 | 4945 | | |
4946 | | - | |
| 4946 | + | |
| 4947 | + | |
| 4948 | + | |
| 4949 | + | |
| 4950 | + | |
| 4951 | + | |
| 4952 | + | |
| 4953 | + | |
| 4954 | + | |
| 4955 | + | |
| 4956 | + | |
| 4957 | + | |
| 4958 | + | |
| 4959 | + | |
| 4960 | + | |
| 4961 | + | |
| 4962 | + | |
| 4963 | + | |
4947 | 4964 | | |
| 4965 | + | |
4948 | 4966 | | |
4949 | 4967 | | |
4950 | 4968 | | |
| |||
4989 | 5007 | | |
4990 | 5008 | | |
4991 | 5009 | | |
4992 | | - | |
4993 | 5010 | | |
4994 | 5011 | | |
4995 | 5012 | | |
| |||
0 commit comments