Re: [PATCH] gfs2: add error handling for kmem_cache_zalloc

From: Andreas Gruenbacher
Date: Tue Jun 12 2018 - 04:23:41 EST


On 12 June 2018 at 09:24, cgxu519@xxxxxxx <cgxu519@xxxxxxx> wrote:
>
>> å 2018å6æ12æïäå11:38ïZhouyang Jia <jiazhouyang09@xxxxxxxxx> åéï
>>
>> When kmem_cache_zalloc fails, the lack of error-handling code may
>> cause unexpected results.
>>
>> This patch adds error-handling code after calling kmem_cache_zalloc.
>
> Should not fail on this case.

Indeed, with the __GFP_NOFAIL flag, kmem_cache_zalloc will not fail.
This is documented in include/linux/gfp.h.

Thanks,
Andreas