mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 09:59:32 +00:00
bcachefs: Fix for __readahead_batch getting partial batch
We were incorrectly ignoring the return value of __readahead_batch, leading to a null ptr deref in __bch2_page_state_create(). Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
33b3b1dc0f
commit
89931472c2
1 changed files with 1 additions and 1 deletions
|
@ -667,7 +667,7 @@ static int readpages_iter_init(struct readpages_iter *iter,
|
|||
if (!iter->pages)
|
||||
return -ENOMEM;
|
||||
|
||||
__readahead_batch(ractl, iter->pages, nr_pages);
|
||||
nr_pages = __readahead_batch(ractl, iter->pages, nr_pages);
|
||||
for (i = 0; i < nr_pages; i++) {
|
||||
__bch2_page_state_create(iter->pages[i], __GFP_NOFAIL);
|
||||
put_page(iter->pages[i]);
|
||||
|
|
Loading…
Reference in a new issue