On 2022/06/14 10:41, lijiang wrote:
Hi, Kazu
Thank you for the fix.
For these two patches:
[1] [PATCH 1/2] sbitmapq: Fix for kernels without struct wait_queue_head
[2] [PATCH 2/2] sbitmapq: Limit kernels without sbitmap again
Acked-by: Lianbo Jiang <lijiang(a)redhat.com <mailto:lijiang@redhat.com>>
Thanks, applied.
Kazu
>
> On Fri, Jun 10, 2022 at 4:07 PM HAGIO KAZUHITO(萩尾 一仁) <k-hagio-ab(a)nec.com
<mailto:k-hagio-ab@nec.com>> wrote:
>
> commit 364b2e413c69 ("sbitmapq: remove struct and member validation
> in sbitmapq_init()") lifted the use of the "sbitmapq" command
> unconditionally. Without the patch, the command fails with the
> following error on kernels without sbitmap:
>
> crash> sbitmapq ffff88015796e550
>
> sbitmapq: invalid structure member offset: sbitmap_queue_sb
> FILE: sbitmap.c LINE: 385 FUNCTION:
sbitmap_queue_context_load()
>
> Now the command supports Linux 4.9 and later kernels since it was
> abstracted out, so it can be limited by the non-existence of the
> sbitmap structure.
>
> Signed-off-by: Kazuhito Hagio <k-hagio-ab(a)nec.com
<mailto:k-hagio-ab@nec.com>>
> ---
> sbitmap.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/sbitmap.c b/sbitmap.c
> index be5d30a8ea88..12d6512a1e4d 100644
> --- a/sbitmap.c
> +++ b/sbitmap.c
> @@ -540,6 +540,10 @@ void sbitmapq_init(void)
> STRUCT_SIZE_INIT(sbitmap_queue, "sbitmap_queue");
> STRUCT_SIZE_INIT(sbq_wait_state, "sbq_wait_state");
>
> + /* sbitmap was abstracted out by commit 88459642cba4 on Linux 4.9. */
> + if (INVALID_SIZE(sbitmap))
> + command_not_supported();
> +
> MEMBER_OFFSET_INIT(sbitmap_word_depth, "sbitmap_word",
"depth");
> MEMBER_OFFSET_INIT(sbitmap_word_word, "sbitmap_word",
"word");
> MEMBER_OFFSET_INIT(sbitmap_word_cleared, "sbitmap_word",
"cleared");
> --
> 2.31.1
>