Linux XFS filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/2] xfs_repair: improve caching in the face of ENOMEM
@ 2026-08-24 19:58 user.mail
  2026-08-24 19:58 ` [PATCH 1/2] xfs_repair: do not allow cache growth to overflow user.mail
  2026-08-24 19:59 ` [PATCH 2/2] xfs_repair: distinguish true ENOMEM from "not found" in cache_node_get user.mail
  0 siblings, 2 replies; 9+ messages in thread
From: user.mail @ 2026-08-24 19:58 UTC (permalink / raw)
  To: linux-xfs

There are problems with how we react to cache allocation failures that
are more apparent before:
6b6239689e36 ("libxfs: unmap xmbuf pages to avoid disaster")
landed, but with enough pressure they show up again.

Two problems: cache_expand has no bounds checking, so call it enough
and c_maxcount will overflow, which typically results in an infinite
loop.

That can be triggered by the fact that today, an underlying ENOMEM
can look like a "cache too small" return, so we double when that
won't help at all. Do that enough times and kaboom.

I can trigger this with something like:

mkfs.xfs -d file,name=testfile.img,agcount=10000,size=1t
echo 1000 > /proc/sys/vm/max_map_count
xfs_repair -n -P -m 1280 testfile.img

to force an ENOMEM from the max map count, though the actual
max_map_count value needed varies depending on the machine I'm on,
for some reason.

These were quickly tested with ./check -g quick


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-08-25 15:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-24 19:58 [PATCH 0/2] xfs_repair: improve caching in the face of ENOMEM user.mail
2026-08-24 19:58 ` [PATCH 1/2] xfs_repair: do not allow cache growth to overflow user.mail
2026-08-25  3:17   ` Darrick J. Wong
2026-08-25 12:36     ` Eric Sandeen
2026-08-24 19:59 ` [PATCH 2/2] xfs_repair: distinguish true ENOMEM from "not found" in cache_node_get user.mail
2026-08-25  3:18   ` Darrick J. Wong
2026-08-25 15:39     ` Eric Sandeen
2026-08-25 15:49       ` Darrick J. Wong
2026-08-25 15:50         ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox