From: Christoph Hellwig <hch@lst.de>
To: "Raphael S. Carvalho" <raphaelsc@scylladb.com>
Cc: linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org,
linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
djwong@kernel.org, Dave Chinner <david@fromorbit.com>,
hch@lst.de, willy@infradead.org
Subject: Re: [PATCH v2] mm: Fix error handling in __filemap_get_folio() with FGP_NOWAIT
Date: Mon, 24 Feb 2025 15:17:44 +0100 [thread overview]
Message-ID: <20250224141744.GA1088@lst.de> (raw)
In-Reply-To: <20250224081328.18090-1-raphaelsc@scylladb.com>
On Mon, Feb 24, 2025 at 05:13:28AM -0300, Raphael S. Carvalho wrote:
> + if (err) {
> + /* Prevents -ENOMEM from escaping to user space with FGP_NOWAIT */
> + if ((fgp_flags & FGP_NOWAIT) && err == -ENOMEM)
> + err = -EAGAIN;
> return ERR_PTR(err);
I don't think the comment is all that useful. It's also overly long.
I'd suggest this instead:
/*
* When NOWAIT I/O fails to allocate folios this could
* be due to a nonblocking memory allocation and not
* because the system actually is out of memory.
* Return -EAGAIN so that there caller retries in a
* blocking fashion instead of propagating -ENOMEM
* to the application.
*/
next prev parent reply other threads:[~2025-02-24 14:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 8:13 [PATCH v2] mm: Fix error handling in __filemap_get_folio() with FGP_NOWAIT Raphael S. Carvalho
2025-02-24 14:17 ` Christoph Hellwig [this message]
2025-02-24 15:33 ` Matthew Wilcox
2025-02-24 15:45 ` Raphael S. Carvalho
2025-02-24 15:49 ` Matthew Wilcox
2025-02-24 15:50 ` Raphael S. Carvalho
2025-02-24 15:51 ` Matthew Wilcox
2025-02-24 15:52 ` Raphael S. Carvalho
2025-02-24 15:56 ` Christoph Hellwig
2025-02-24 16:02 ` Christoph Hellwig
2025-02-24 16:15 ` Raphael S. Carvalho
2025-02-25 16:04 ` Raphael S. Carvalho
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=20250224141744.GA1088@lst.de \
--to=hch@lst.de \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=raphaelsc@scylladb.com \
--cc=willy@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.