On Wed, Apr 27, 2022 at 12:22:58PM +1000, Dave Chinner wrote: > + if (!atomic_dec_and_test(&buip->bui_refcount)) > + return; > + > + if (test_bit(XFS_LI_IN_AIL, &buip->bui_item.li_flags)) > xfs_trans_ail_delete(&buip->bui_item, SHUTDOWN_LOG_IO_ERROR); Wouldn't it make more sense to just call xfs_trans_ail_delete with shutdown_type set to 0 here? That mean there will be another ail_lock cycle if it isn't in the AIL (do we even need that the I think single remaining other caller?), but the code would be simpler and self-documenting. Same for the other instances.