Skip to contentSkip to conversation

make log force warnings less annoying

PATCH In review Christoph Hellwig 5 participants 8 messages Dec 29, 2016 – Jan 9, 2017 XFS filesystem

lore
Share & tools
lore
#0 lore raw

I've recently had various issues root causing customer bug reports due to xfs_log_force spamming the log with EIO warnings that are not helpful at all. This patch just removes them as they add no value.

I'd love to see this patch go into the next 4.10-rc and 4.9-stable so that I can improve the quality of bug reports.

#1 lore raw

PATCH 1/1 xfs: don't print warnings when xfs_log_force fails

There are only two reasons for xfs_log_force / xfs_log_force_lsn to fail:
one is an I/O error, for which xlog_bdstrat already logs a warning, and the second is an already shutdown log due to a previous I/O errors. In the latter case we'll already have a previous indication for the actual error, but the large stream of misleading warnings from xfs_log_force will probably scroll it out of the message buffer.

Simply removing the warnings thus makes the XFS log reporting significantly better.

---
 fs/xfs/xfs_log.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
fs/xfs/xfs_log.c +2 -10
index c39ac14..b1469f0 100644
@@ -3317,12 +3317,8 @@ xfs_log_force(
 	xfs_mount_t	*mp,
 	uint		flags)
 {
-	int	error;
-
 	trace_xfs_log_force(mp, 0, _RET_IP_);
-	error = _xfs_log_force(mp, flags, NULL);
-	if (error)
-		xfs_warn(mp, "%s: error %d returned.", __func__, error);
+	_xfs_log_force(mp, flags, NULL);
 }
 
 /*
@@ -3466,12 +3462,8 @@ xfs_log_force_lsn(
 	xfs_lsn_t	lsn,
 	uint		flags)
 {
-	int	error;
-
 	trace_xfs_log_force(mp, lsn, _RET_IP_);
-	error = _xfs_log_force_lsn(mp, lsn, flags, NULL);
-	if (error)
-		xfs_warn(mp, "%s: error %d returned.", __func__, error);
+	_xfs_log_force_lsn(mp, lsn, flags, NULL);
 }
 
 /*
Signature · 1 line
2.1.4
#2 lore raw

Re: [PATCH] xfs: don't print warnings when xfs_log_force fails

Quoted 11 lines · Christoph Hellwig

There are only two reasons for xfs_log_force / xfs_log_force_lsn to fail:
one is an I/O error, for which xlog_bdstrat already logs a warning, and the second is an already shutdown log due to a previous I/O errors. In the latter case we'll already have a previous indication for the actual error, but the large stream of misleading warnings from xfs_log_force will probably scroll it out of the message buffer.

Simply removing the warnings thus makes the XFS log reporting significantly better.

This sounds like a good idea, though I haven't really reviewed the code itself. But I'd say a one line comment indicating why errors from _xfs_log_force() are being ignored might be good.

-Alex

Quoted 37 lines
---
 fs/xfs/xfs_log.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
fs/xfs/xfs_log.c +2 -10
index c39ac14..b1469f0 100644
@@ -3317,12 +3317,8 @@ xfs_log_force(
 	xfs_mount_t	*mp,
 	uint		flags)
 {
-	int	error;
-
 	trace_xfs_log_force(mp, 0, _RET_IP_);
-	error = _xfs_log_force(mp, flags, NULL);
-	if (error)
-		xfs_warn(mp, "%s: error %d returned.", __func__, error);
+	_xfs_log_force(mp, flags, NULL);
 }
 
 /*
@@ -3466,12 +3462,8 @@ xfs_log_force_lsn(
 	xfs_lsn_t	lsn,
 	uint		flags)
 {
-	int	error;
-
 	trace_xfs_log_force(mp, lsn, _RET_IP_);
-	error = _xfs_log_force_lsn(mp, lsn, flags, NULL);
-	if (error)
-		xfs_warn(mp, "%s: error %d returned.", __func__, error);
+	_xfs_log_force_lsn(mp, lsn, flags, NULL);
 }
 
 /*
#3 lore raw

Re: [PATCH] xfs: don't print warnings when xfs_log_force fails

Quoted 3 lines · Alex Elder

This sounds like a good idea, though I haven't really reviewed the code itself. But I'd say a one line comment indicating why errors from _xfs_log_force() are being ignored might be good.

I don't really know the answer, but it probabls is: some callers shouldn't ignore it and others can't handle it either. Maybe I'll need to some further work in this area, but it's not really related to dropping the message.

#4 lore raw

Re: [PATCH] xfs: don't print warnings when xfs_log_force fails

Quoted 10 lines · Christoph Hellwig
Quoted 3 lines · Alex Elder

This sounds like a good idea, though I haven't really reviewed the code itself. But I'd say a one line comment indicating why errors from _xfs_log_force() are being ignored might be good.

I don't really know the answer, but it probabls is: some callers shouldn't ignore it and others can't handle it either. Maybe I'll need to some further work in this area, but it's not really related to dropping the message.

I actually misspoke.

What I *meant* to say was that a comment about why we don't want to log a message in these spots might be nice. But now I'm less interested in that and more interested in why errors from _xfs_log_force*() can be ignored.

Anyway, I won't claim to have reviewed this, but your change makes sense to me.

-Alex

Reviewed-by on v1 1/1
#5 lore raw

Re: [PATCH] xfs: don't print warnings when xfs_log_force fails

In reply to Christoph Hellwig
Quoted 9 lines · Christoph Hellwig

There are only two reasons for xfs_log_force / xfs_log_force_lsn to fail:
one is an I/O error, for which xlog_bdstrat already logs a warning, and the second is an already shutdown log due to a previous I/O errors. In the latter case we'll already have a previous indication for the actual error, but the large stream of misleading warnings from xfs_log_force will probably scroll it out of the message buffer.

Simply removing the warnings thus makes the XFS log reporting significantly better.

Stop spamming the kernel log with the "error -5 returned." messages will be great.

The code looks good too.

you can add:

Cheers

Quoted 45 lines
---
 fs/xfs/xfs_log.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
fs/xfs/xfs_log.c +2 -10
index c39ac14..b1469f0 100644
@@ -3317,12 +3317,8 @@ xfs_log_force(
 	xfs_mount_t	*mp,
 	uint		flags)
 {
-	int	error;
-
 	trace_xfs_log_force(mp, 0, _RET_IP_);
-	error = _xfs_log_force(mp, flags, NULL);
-	if (error)
-		xfs_warn(mp, "%s: error %d returned.", __func__, error);
+	_xfs_log_force(mp, flags, NULL);
 }
 
 /*
@@ -3466,12 +3462,8 @@ xfs_log_force_lsn(
 	xfs_lsn_t	lsn,
 	uint		flags)
 {
-	int	error;
-
 	trace_xfs_log_force(mp, lsn, _RET_IP_);
-	error = _xfs_log_force_lsn(mp, lsn, flags, NULL);
-	if (error)
-		xfs_warn(mp, "%s: error %d returned.", __func__, error);
+	_xfs_log_force_lsn(mp, lsn, flags, NULL);
 }
 
 /*
Signature · 6 lines
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Carlos
#6 lore raw

Re: [PATCH] xfs: don't print warnings when xfs_log_force fails

In reply to Christoph Hellwig
Quoted 9 lines · Christoph Hellwig

There are only two reasons for xfs_log_force / xfs_log_force_lsn to fail:
one is an I/O error, for which xlog_bdstrat already logs a warning, and the second is an already shutdown log due to a previous I/O errors. In the latter case we'll already have a previous indication for the actual error, but the large stream of misleading warnings from xfs_log_force will probably scroll it out of the message buffer.

Simply removing the warnings thus makes the XFS log reporting significantly better.

Darrick,

any opinion on this one? I was hoping to sneak it into 4.10-rc still..

Reviewed-by on v1 1/1
#7 lore raw

Re: [PATCH] xfs: don't print warnings when xfs_log_force fails

In reply to Christoph Hellwig
Quoted 9 lines · Christoph Hellwig

There are only two reasons for xfs_log_force / xfs_log_force_lsn to fail:
one is an I/O error, for which xlog_bdstrat already logs a warning, and the second is an already shutdown log due to a previous I/O errors. In the latter case we'll already have a previous indication for the actual error, but the large stream of misleading warnings from xfs_log_force will probably scroll it out of the message buffer.

Simply removing the warnings thus makes the XFS log reporting significantly better.

Looks ok to me, so:

--D

Quoted 45 lines
---
 fs/xfs/xfs_log.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
fs/xfs/xfs_log.c +2 -10
index c39ac14..b1469f0 100644
@@ -3317,12 +3317,8 @@ xfs_log_force(
 	xfs_mount_t	*mp,
 	uint		flags)
 {
-	int	error;
-
 	trace_xfs_log_force(mp, 0, _RET_IP_);
-	error = _xfs_log_force(mp, flags, NULL);
-	if (error)
-		xfs_warn(mp, "%s: error %d returned.", __func__, error);
+	_xfs_log_force(mp, flags, NULL);
 }
 
 /*
@@ -3466,12 +3462,8 @@ xfs_log_force_lsn(
 	xfs_lsn_t	lsn,
 	uint		flags)
 {
-	int	error;
-
 	trace_xfs_log_force(mp, lsn, _RET_IP_);
-	error = _xfs_log_force_lsn(mp, lsn, flags, NULL);
-	if (error)
-		xfs_warn(mp, "%s: error %d returned.", __func__, error);
+	_xfs_log_force_lsn(mp, lsn, flags, NULL);
 }
 
 /*
Signature · 6 lines
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html