On Fri, Jul 12, 2024 at 12:28:57PM GMT, Youling Tang wrote:We should use kmem_cache_alloc_lru() instead of kmem_cache_alloc(),
Hi, KentNo, you're just hiding the actual bug - since I wasn't clear, I'm naking
On 12/07/2024 12:07, Kent Overstreet wrote:
On Fri, Jul 12, 2024 at 11:25:54AM GMT, Youling Tang wrote:We can break it down into two questions (independent of each other):
From: Youling Tang <tangyouling@xxxxxxxxxx>I see no explanation for why this is the correct fix, and I doubt it is.
Note that list_lru_from_memcg_idx() may return NULL, so it is necessary
to error handle the return value to avoid triggering NULL pointer
dereference BUG.
The issue was triggered for discussion [1],
Link [1]: https://lore.kernel.org/linux-bcachefs/84de6cb1-57bd-42f7-8029-4203820ef0b4@xxxxxxxxx/T/#m901bb26cdb1d9d4bacebf0d034f0a5a712cc93a6
What's the real reason for the NULL lru_list_one, and why doesn't this
come up on other filesystems?
1) Error handling is necessary when l (lru_list_one) is NULL here.
this patch.