linux-stable/tools/testing
Maor Gottlieb 3e302dbc67 lib/scatterlist: Fix wrong update of orig_nents
orig_nents should represent the number of entries with pages,
but __sg_alloc_table_from_pages sets orig_nents as the number of
total entries in the table. This is wrong when the API is used for
dynamic allocation where not all the table entries are mapped with
pages. It wasn't observed until now, since RDMA umem who uses this
API in the dynamic form doesn't use orig_nents implicit or explicit
by the scatterlist APIs.

Fix it by changing the append API to track the SG append table
state and have an API to free the append table according to the
total number of entries in the table.
Now all APIs set orig_nents as number of enries with pages.

Fixes: 07da1223ec ("lib/scatterlist: Add support in dynamic allocation of SG table from pages")
Link: https://lore.kernel.org/r/20210824142531.3877007-3-maorg@nvidia.com
Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2021-08-24 19:52:40 -03:00
..
fault-injection
ktest bootconfig/tracing/ktest: Add ktest examples of testing bootconfig 2021-06-24 15:34:33 -04:00
kunit kunit: tool: Assert the version requirement 2021-07-12 14:02:32 -06:00
nvdimm tools/testing/nvdimm: Fix missing 'fallthrough' warning 2021-08-11 11:55:54 -07:00
radix-tree idr test suite: Improve reporting from idr_find_test_1 2021-04-01 07:50:42 -04:00
scatterlist lib/scatterlist: Fix wrong update of orig_nents 2021-08-24 19:52:40 -03:00
selftests linux-kselftest-fixes-5.14-rc6 2021-08-13 14:32:38 -10:00
vsock vsock_test: add SOCK_SEQPACKET tests 2021-06-11 13:32:47 -07:00