On Wed, Apr 22, 2020 at 01:54:18PM -0400, Brian Foster wrote: > We use the same buffer I/O failure simulation code in a few > different places. It's not much code, but it's not necessarily > self-explanatory. Factor it into a helper and document it in one > place. The code looks good, but the term simularion sounds rather strange in this context. We don't really simulate an I/O failure, but we fail the buffer with -EIO due to a file system shutdown. I'd also just keep the ORing of XBF_ASYNC into b_flags in the two callers, as that keeps the function a little more "compact".