diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2024-01-01 10:38:48 +0100 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-01-05 19:17:43 +0100 |
commit | bcd30d4cd937e8e15c3986358c5e601135475ce1 (patch) | |
tree | 5627fe36447141833d470f0f480ff819dafeffe4 /mm | |
parent | zswap: memcontrol: implement zswap writeback disabling (diff) | |
download | linux-bcd30d4cd937e8e15c3986358c5e601135475ce1.tar.xz linux-bcd30d4cd937e8e15c3986358c5e601135475ce1.zip |
buffer: fix unintended successful return
If try_to_free_buffers() succeeded and then folio_alloc_buffers() failed,
grow_dev_folio() would return success. This would be incorrect; memory
allocation failure is supposed to result in a failure. It's a harmless
bug; the caller will simply go around the loop one more time and
grow_dev_folio() will correctly return a failure that time. But it was an
unintended change and looks like a more serious bug than it is.
While I'm in here, improve the commentary about why we return success even
though we failed.
Link: https://lkml.kernel.org/r/20240101093848.2017115-1-willy@infradead.org
Fixes: 6d840a18773f ("buffer: return bool from grow_dev_folio()")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reported-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions