]> www.infradead.org Git - users/dwmw2/linux.git/commit
watch_queue: Fix the alloc bitmap size to reflect notes allocated
authorDavid Howells <dhowells@redhat.com>
Fri, 11 Mar 2022 13:24:22 +0000 (13:24 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Mar 2022 13:16:02 +0000 (14:16 +0100)
commit880acbb718e15e46d37fcde75fa52d5cb4336dca
tree0764d1681e5e27b0513191cc6c1320b4802b7ad3
parente2b52ca4988e12ad75aeece53c4f0af849f0d9dc
watch_queue: Fix the alloc bitmap size to reflect notes allocated

commit 3b4c0371928c17af03e8397ac842346624017ce6 upstream.

Currently, watch_queue_set_size() sets the number of notes available in
wqueue->nr_notes according to the number of notes allocated, but sets
the size of the bitmap to the unrounded number of notes originally asked
for.

Fix this by setting the bitmap size to the number of notes we're
actually going to make available (ie. the number allocated).

Fixes: c73be61cede5 ("pipe: Add general notification queue support")
Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/watch_queue.c