xfs: ratelimit xfs_buf_ioerror_alert messages
authorChristoph Hellwig <hch@lst.de>
Fri, 21 Feb 2020 15:34:47 +0000 (07:34 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 3 Mar 2020 04:55:51 +0000 (20:55 -0800)
Use printk_ratelimit() to limit the amount of messages printed from
xfs_buf_ioerror_alert.  Without that a failing device causes a large
number of errors that doesn't really help debugging the underling
issue.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_buf.c

index c805ffae8913002cb3d37dae77e69f7b8e22e97b..f8e4fee206ffe1d7d8199db0d8312009c2556f70 100644 (file)
@@ -1239,7 +1239,7 @@ xfs_buf_ioerror_alert(
        struct xfs_buf          *bp,
        xfs_failaddr_t          func)
 {
-       xfs_alert(bp->b_mount,
+       xfs_alert_ratelimited(bp->b_mount,
 "metadata I/O error in \"%pS\" at daddr 0x%llx len %d error %d",
                        func, (uint64_t)XFS_BUF_ADDR(bp), bp->b_length,
                        -bp->b_error);