Linux XFS filesystem development
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: linux-xfs@vger.kernel.org
Cc: djwong@kernel.org, aalbersh@kernel.org
Subject: [PATCH 0/3 V3] libxfs: better cache allocation error handling
Date: Fri, 25 Sep 2026 14:41:42 -0500	[thread overview]
Message-ID: <20260925194535.397036-1-sandeen@redhat.com> (raw)

OK, 3rd try.

This is to handle an underlying problem that an actual ENOMEM cache
node allocation failure is indistinguishable from "current cache full"
and so ENOMEM may send us into a pointless cache-expansion loop which
ultimately overflows the cache size variable, rather than just reporting
the bad news up the chain to callers.

Darrick suggested "I think I'd almost rather we change cache_node_allocate
to return int and the cache node as an outparam since we do that elsewhere"

on the last review cycle, and so I've done that here, I agree that it
is cleaner.

The first patch is maybe too granular but for some reason this stuff
hurts my brain a little and I thought it helped with clarity; it's a
no-op change to cache_node_allocate's signature, returning an int
and passing the cache node as a param.

Second patch should actually catch and bubble up any low-level error.

3rd patch is defensive against a case which in theory should almost never
happen after the other fixes.


             reply	other threads:[~2026-09-25 19:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25 19:41 Eric Sandeen [this message]
2026-09-25 19:41 ` [PATCH 1/3] libxfs: change cache_node_allocate function signature Eric Sandeen
2026-09-25 22:56   ` Darrick J. Wong
2026-09-25 19:41 ` [PATCH 2/3] libxfs: Return -ENOMEM on actual cache node allocation failures Eric Sandeen
2026-09-25 22:58   ` Darrick J. Wong
2026-09-28 15:07     ` Eric Sandeen
2026-09-25 19:41 ` [PATCH 3/3] libxfs: do not allow cache growth to overflow Eric Sandeen
2026-09-25 22:59   ` Darrick J. Wong
2026-09-28  8:16 ` [PATCH 0/3 V3] libxfs: better cache allocation error handling Christoph Hellwig
2026-09-28 15:05   ` Eric Sandeen

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=20260925194535.397036-1-sandeen@redhat.com \
    --to=sandeen@redhat.com \
    --cc=aalbersh@kernel.org \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.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