Re: [PATCH] xfs: shutdown on failure to add page to log bio

Dave Chinner
2020-03-24T23:24:27Z

On Tue, Mar 24, 2020 at 12:57:00PM -0400, Brian Foster wrote:
> If the bio_add_page() call fails, we proceed to write out a
> partially constructed log buffer. This corrupts the physical log
> such that log recovery is not possible. Worse, persistent
> occurrences of this error eventually lead to a BUG_ON() failure in
> bio_split() as iclogs wrap the end of the physical log, which
> triggers log recovery on subsequent mount.

I'm a little unclear on how this can happen - the iclogbuf can only
be 256kB - 64 pages - and we always allocation a bio with enough
bvecs to hold 64 pages. And the ic_data buffer we are adding to the
bio is also statically allocated so I'm left to wonder exactly how
this is failing.

i.e. this looks like code that shouldn't ever fail, yet it
apparently is, and I have no idea what is causing that failure...

That said, shutting down on failure is the right thing to do, so the
code looks good. I just want to know how the bio_add_page() failure
is occurring.

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com