Re: [PATCH 5/7] xfs: factor iclog state processing out of xlog_state_do_callback()

Christoph Hellwig
2019-09-04T06:42:22Z

On Wed, Sep 04, 2019 at 02:24:49PM +1000, Dave Chinner wrote:
> + /* Skip all iclogs in the ACTIVE & DIRTY states */
> + if (iclog->ic_state & (XLOG_STATE_ACTIVE|XLOG_STATE_DIRTY))
> + return false;

Please use spaces around the "|".

> + if (iclog->ic_state & XLOG_STATE_IOERROR)
> + ioerrors++;

This now also counts the ierrror flag for dirty and active iclogs.
Not sure it matters given our state machine, but it does change
behavior.

> + ret = xlog_state_iodone_process_iclog(log, iclog,
> + ciclog);
> + if (ret)
> + break;

No need for the ret variable.

>
> - } else
> - ioerrors++;
> + if (!(iclog->ic_state &
> + (XLOG_STATE_CALLBACK | XLOG_STATE_IOERROR))) {
> + iclog = iclog->ic_next;
> + continue;
> + }

Btw, one cleanup I had pending is that all our loops ovr the iclog
list can be cleaned up nicely so that continue does that right thing
without all these manual "iclog = iclog->ic_next" next statements. Just
turn the loop into:

do {
..
} while ((iclog = iclog->ic_next) != first_iclog);

this might be applicable to a few of your patches.