diff mbox series

[1/2] xfs: ratelimit xfs_buf_ioerror_alert

Message ID 20200220040549.366547-2-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/2] xfs: ratelimit xfs_buf_ioerror_alert | expand

Commit Message

Christoph Hellwig Feb. 20, 2020, 4:05 a.m. UTC
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>
---
 fs/xfs/xfs_buf.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Brian Foster Feb. 20, 2020, 2:12 p.m. UTC | #1
On Wed, Feb 19, 2020 at 08:05:48PM -0800, Christoph Hellwig wrote:
> 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>
> ---
>  fs/xfs/xfs_buf.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> index 217e4f82a44a..e010680a665e 100644
> --- a/fs/xfs/xfs_buf.c
> +++ b/fs/xfs/xfs_buf.c
> @@ -1238,6 +1238,8 @@ xfs_buf_ioerror_alert(
>  	struct xfs_buf		*bp,
>  	xfs_failaddr_t		func)
>  {
> +	if (!printk_ratelimit())
> +		return;

xfs_alert_ratelimited() ?

Brian

>  	xfs_alert(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,
> -- 
> 2.24.1
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 217e4f82a44a..e010680a665e 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1238,6 +1238,8 @@  xfs_buf_ioerror_alert(
 	struct xfs_buf		*bp,
 	xfs_failaddr_t		func)
 {
+	if (!printk_ratelimit())
+		return;
 	xfs_alert(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,