Whamcloud - gitweb
LU-18187 ldlm: use cfs hash extra_bits 90/56290/11
authorShaun Tancheff <shaun.tancheff@hpe.com>
Sat, 15 Feb 2025 11:01:06 +0000 (18:01 +0700)
committerOleg Drokin <green@whamcloud.com>
Sat, 22 Feb 2025 23:41:44 +0000 (23:41 +0000)
commitee494113b1a403c0f235b6c340596ef3f39e1f87
tree44dd7601fa5dbd823b750e8d3144a1fa355e08cc
parent7ccf62a6edd8c50ee344a59be25c28d4faf29619
LU-18187 ldlm: use cfs hash extra_bits

BUG: KASAN: vmalloc-out-of-bounds in \\
ldlm_reclaim_lock_cb+0xa46/0xa50 [ptlrpc]

In ldlm_namespace_new() allocation of ns_rs_buckets can be replaced
with extra bits sized to hold struct ldlm_ns_bucket. Then
cfs_hash_bd_extra_get() can be used to access struct ldlm_ns_bucket.

This should resolve the inconsistency that could occur after
cfs_hash_buckets_realloc().

HPE-bug-id: LUS-12508
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I13af91d400c12891a4bab5c4443dc3d3cbd25da4
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56290
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/include/libcfs/libcfs_hash.h
lustre/include/lustre_dlm.h
lustre/ldlm/ldlm_resource.c