> if (pag->pagi_freecount) { > xfs_perag_put(pag); > + *IO_agbp = agbp; > + return 0; I think assigning *IO_agbp would benefit from a little consolidation. Set it to NULL in the normal unsuccessful return, and add a found_ag label that assigns agbp and returns 0. Otherwise looks good: Reviewed-by: Christoph Hellwig <hch@xxxxxx>