[PATCH 5/9] repair: detect CRC errors in AG headers
Christoph Hellwig
hch at infradead.org
Fri Apr 25 00:55:16 CDT 2014
> sb = (xfs_sb_t *)calloc(BBSIZE, 1);
If you already do various cosmetic changes I'd recommend removing the
useles case here as well.
> - if (status & XR_AG_AGF) {
> + if (agf_dirty || status & XR_AG_AGF) {
> - if (status & XR_AG_AGI) {
> + if (agi_dirty || status & XR_AG_AGI) {
I can't see how agf_dirty and agi_dirty would ever be set at this point.
> +out_free:
> + if (sb)
> + free(sb);
> + if (agibuf)
> + libxfs_putbuf(agibuf);
> + if (agfbuf)
> + libxfs_putbuf(agfbuf);
> + if (sbbuf)
> + libxfs_putbuf(sbbuf);
> + if (objname)
> + do_error(_("can't get %s for ag %d\n"), objname, agno);
> + return;
No need for a return statement at the end of a void returning function.
Also any reason for not using one goto for each unwind step like we do
elsewhere instead of the if (!NULL) checks?
More information about the xfs
mailing list