diff mbox

[v2,2/2] btrfs-progs: Modify confuse error message in scrub

Message ID 4d18a89d55f130df60c9c604881599172cde0459.1438830282.git.zhaolei@cn.fujitsu.com (mailing list archive)
State Accepted
Headers show

Commit Message

Zhaolei Aug. 6, 2015, 3:05 a.m. UTC
Scrub output following error message in my test:
  ERROR: scrubbing /var/ltf/tester/scratch_mnt failed for device id 5 (Success)

It is caused by a broken kernel and fs, but the we need to avoid
outputting both "error and success" in oneline message as above.

This patch modified above message to:
  ERROR: scrubbing /var/ltf/tester/scratch_mnt failed for device id 5, ret=1, errno=0(Success)

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
 cmds-scrub.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

David Sterba Sept. 25, 2015, 4:44 p.m. UTC | #1
On Thu, Aug 06, 2015 at 11:05:55AM +0800, Zhao Lei wrote:
> Scrub output following error message in my test:
>   ERROR: scrubbing /var/ltf/tester/scratch_mnt failed for device id 5 (Success)
> 
> It is caused by a broken kernel and fs, but the we need to avoid
> outputting both "error and success" in oneline message as above.
> 
> This patch modified above message to:
>   ERROR: scrubbing /var/ltf/tester/scratch_mnt failed for device id 5, ret=1, errno=0(Success)
> 
> Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/cmds-scrub.c b/cmds-scrub.c
index a40eecf..2529956 100644
--- a/cmds-scrub.c
+++ b/cmds-scrub.c
@@ -1469,8 +1469,9 @@  static int scrub_start(int argc, char **argv, int resume)
 				break;
 			default:
 				if (do_print)
-					fprintf(stderr, "ERROR: scrubbing %s failed for device id %lld (%s)\n",
+					fprintf(stderr, "ERROR: scrubbing %s failed for device id %lld, ret=%d, errno=%d(%s)\n",
 						path, devid,
+						sp[i].ret, sp[i].ioctl_errno,
 						strerror(sp[i].ioctl_errno));
 				++err;
 				continue;