lkml.org 
[lkml]   [2022]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Cluster-devel] [PATCH] gfs2: Add check for mempool_alloc
On Fri, Apr 01, 2022 at 11:37:55AM +0800, Jiasheng Jiang wrote:
> >> Fixes: e8c92ed76900 ("GFS2: Clean up log write code path")
> >> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> >
> > Please explain how it could fail to start with.
>
> I think that for safety, the cost of redundant and harmless
> check is acceptable.
> Also, checking after allocation is a good program pattern.
> Therefore, it should be better to check it although it is
> hard to fail.

Please take a look at the implemetation and documentation of
mempool_alloc again. Thewhole point of that function is that it will
not fail for allocations that can sleep.

\
 
 \ /
  Last update: 2022-09-17 16:19    [W:0.033 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site