From: Christoph Hellwig <hch@infradead.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] gfs2: Add check for mempool_alloc
Date: Thu, 31 Mar 2022 21:46:21 -0700 [thread overview]
Message-ID: <YkaDnfLS8T0HszoV@infradead.org> (raw)
In-Reply-To: <20220401033755.1892644-1-jiasheng@iscas.ac.cn>
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.
next prev parent reply other threads:[~2022-04-01 4:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-01 3:37 [Cluster-devel] [PATCH] gfs2: Add check for mempool_alloc Jiasheng Jiang
2022-04-01 4:46 ` Christoph Hellwig [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-03-11 8:36 Jiasheng Jiang
2022-03-30 15:56 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YkaDnfLS8T0HszoV@infradead.org \
--to=hch@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).