On 4/17/20 8:08 AM, Brian Foster wrote:
At unmount time, XFS emits a warning for every in-core buffer that might have undergone a write error. In practice this behavior is probably reasonable given that the filesystem is likely short lived once I/O errors begin to occur consistently. Under certain test or otherwise expected error conditions, this can spam the logs and slow down the unmount. Ratelimit the warning to prevent this problem while still informing the user that errors have occurred. Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx>
Ok, other than the line return Dave pointed out, looks ok to me: Reviewed-by: Allison Collins <allison.henderson@xxxxxxxxxx>
--- fs/xfs/xfs_buf.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 93942d8e35dd..5120fed06075 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -1685,11 +1685,10 @@ xfs_wait_buftarg( bp = list_first_entry(&dispose, struct xfs_buf, b_lru); list_del_init(&bp->b_lru); if (bp->b_flags & XBF_WRITE_FAIL) { - xfs_alert(btp->bt_mount, -"Corruption Alert: Buffer at daddr 0x%llx had permanent write failures!", + xfs_alert_ratelimited(btp->bt_mount, +"Corruption Alert: Buffer at daddr 0x%llx had permanent write failures!\n" +"Please run xfs_repair to determine the extent of the problem.", (long long)bp->b_bn); - xfs_alert(btp->bt_mount, -"Please run xfs_repair to determine the extent of the problem."); } xfs_buf_rele(bp); }