Skip to content

libxfs: better cache allocation error handling

Eric Sandeen linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest3 patches 6 repliesIn review

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3libxfs: change cache_node_allocate function signaturelibxfs/cache.c+17 -91 reply
2/3libxfs: Return -ENOMEM on actual cache node allocation failureslibxfs/cache.c libxfs/rdwr.c+20 -112 replies
3/3libxfs: do not allow cache growth to overflowlibxfs/cache.c+15 -51 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchDarrick J. Wong
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH 0/3 V3] libxfs: better cache allocation error handling

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.