mbox series

[v3,00/13] xfs: make buffer functions return error codes

Message ID 157956098906.1166689.13651975861399490259.stgit@magnolia
Headers show
Series xfs: make buffer functions return error codes | expand

Message

Darrick J. Wong Jan. 20, 2020, 10:56 p.m. UTC
Hi all,

Let's fix all the xfs read/get buffer functions to return the usual
integer error codes and pass the buffer pointer as a out-argument.  This
makes it so that we can return useful error output instead of making
callers infer ENOMEM or EAGAIN or whatever other reality they crave from
the NULL pointer that they get when things don't go perfectly.

FWIW, all XBF_TRYLOCK callers must now trigger retries if they receive
EAGAIN.  This may lead to a slight behavioral change in that TRYLOCK
callers will no longer retry for things like ENOMEM, though I didn't see
any obvious changes in user-visible behavior when running fstests.

After finishing the error code conversion, we straighten out the TRYLOCK
callers to remove all this null pointer checks in favor of explicit
EAGAIN checks; and then we refactor the code that handles buffer state
changes and logging after an IO/verifier error so that we handle all of
that from within the buffer functions instead of open-coding that
everywhere.

This has been lightly tested with fstests.  Enjoy!
Comments and questions are, as always, welcome.

--D