Skip to contentSkip to conversation

btrfs-progs: Unify the messy error message formats

PATCH Superseded Satoru Takeuchi 2 participants 4 messages Jul 25, 2014 – Jul 29, 2014 Btrfs file system

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 btrfs-progs: Unify the messy error message formats

From: Satoru Takeuchi <[email protected]>

- There are many format to show snapshot name in error messages, "'%s'", "'%s", "%s", "('%s')", and "('%s)". Since it's messy, unify these to "'%s'" format.
- Fix a type: s/uncorrect/incorrect/

---
 cmds-subvolume.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
cmds-subvolume.c +8 -8
index b7bfb3e..ce38503 100644
@@ -140,14 +140,14 @@ static int cmd_subvol_create(int argc, char **argv)
 	dstdir = dirname(dupdir);
 
 	if (!test_issubvolname(newname)) {
-		fprintf(stderr, "ERROR: uncorrect subvolume name ('%s')\n",
+		fprintf(stderr, "ERROR: incorrect subvolume name '%s'\n",
 			newname);
 		goto out;
 	}
 
 	len = strlen(newname);
 	if (len == 0 || len >= BTRFS_VOL_NAME_MAX) {
-		fprintf(stderr, "ERROR: subvolume name too long ('%s)\n",
+		fprintf(stderr, "ERROR: subvolume name too long '%s'\n",
 			newname);
 		goto out;
 	}
@@ -314,7 +314,7 @@ again:
 	free(cpath);
 
 	if (!test_issubvolname(vname)) {
-		fprintf(stderr, "ERROR: incorrect subvolume name ('%s')\n",
+		fprintf(stderr, "ERROR: incorrect subvolume name '%s'\n",
 			vname);
 		ret = 1;
 		goto out;
@@ -322,7 +322,7 @@ again:
 
 	len = strlen(vname);
 	if (len == 0 || len >= BTRFS_VOL_NAME_MAX) {
-		fprintf(stderr, "ERROR: snapshot name too long ('%s)\n",
+		fprintf(stderr, "ERROR: too long snapshot name '%s'\n",
 			vname);
 		ret = 1;
 		goto out;
@@ -722,14 +722,14 @@ static int cmd_snapshot(int argc, char **argv)
 	}
 
 	if (!test_issubvolname(newname)) {
-		fprintf(stderr, "ERROR: incorrect snapshot name ('%s')\n",
+		fprintf(stderr, "ERROR: incorrect snapshot name '%s'\n",
 			newname);
 		goto out;
 	}
 
 	len = strlen(newname);
 	if (len == 0 || len >= BTRFS_VOL_NAME_MAX) {
-		fprintf(stderr, "ERROR: snapshot name too long ('%s)\n",
+		fprintf(stderr, "ERROR: snapshot name too long '%s'\n",
 			newname);
 		goto out;
 	}
@@ -778,7 +778,7 @@ static int cmd_snapshot(int argc, char **argv)
 	res = ioctl(fddst, BTRFS_IOC_SNAP_CREATE_V2, &args);
 
 	if (res < 0) {
-		fprintf( stderr, "ERROR: cannot snapshot %s - %s\n",
+		fprintf( stderr, "ERROR: cannot snapshot '%s' - %s\n",
 			subvol_descr, strerror(errno));
 		goto out;
 	}
@@ -991,7 +991,7 @@ static int cmd_subvol_show(int argc, char **argv)
 
 	ret = find_mount_root(fullpath, &mnt);
 	if (ret < 0) {
-		fprintf(stderr, "ERROR: find_mount_root failed on %s: "
+		fprintf(stderr, "ERROR: find_mount_root failed on '%s': "
 				"%s\n", fullpath, strerror(-ret));
 		goto out;
 	}
Signature · 1 line
1.9.3
#1 lore raw

small wording error inline below

----------------------------------------

Quoted 49 lines

Date: Fri, 25 Jul 2014 15:17:05 +0900
From: [email protected]
To: [email protected]
Subject: [PATCH 2/2] btrfs-progs: Unify the messy error message formats

From: Satoru Takeuchi <[email protected]>

- There are many format to show snapshot name in error messages, "'%s'", "'%s", "%s", "('%s')", and "('%s)". Since it's messy, unify these to "'%s'" format.
- Fix a type: s/uncorrect/incorrect/

---
cmds-subvolume.c | 16 ++++++++--------

1 file changed, 8 insertions(+), 8 deletions(-)
cmds-subvolume.c +3 -3
index b7bfb3e..ce38503 100644
@@ -140,14 +140,14 @@ static int cmd_subvol_create(int argc, char **argv)
 dstdir = dirname(dupdir);
 
 if (!test_issubvolname(newname)) {
- fprintf(stderr, "ERROR: uncorrect subvolume name ('%s')\n",
+ fprintf(stderr, "ERROR: incorrect subvolume name '%s'\n",
 newname);
 goto out;
 }
 
 len = strlen(newname);
 if (len == 0 || len>= BTRFS_VOL_NAME_MAX) {
- fprintf(stderr, "ERROR: subvolume name too long ('%s)\n",
+ fprintf(stderr, "ERROR: subvolume name too long '%s'\n",
 newname);
 goto out;
 }
@@ -314,7 +314,7 @@ again:
 free(cpath);
 
 if (!test_issubvolname(vname)) {
- fprintf(stderr, "ERROR: incorrect subvolume name ('%s')\n",
+ fprintf(stderr, "ERROR: incorrect subvolume name '%s'\n",
 vname);
 ret = 1;
 goto out;

cmds-subvolume.c again: · line 325

Quoted 5 lines
cmds-subvolume.c +1 -1
@@ -322,7 +322,7 @@ again:
 
 len = strlen(vname);
 if (len == 0 || len>= BTRFS_VOL_NAME_MAX) {
- fprintf(stderr, "ERROR: snapshot name too long ('%s)\n",
+ fprintf(stderr, "ERROR: too long snapshot name '%s'\n",

+ fprintf(stderr, "ERROR: snapshot name too long '%s'\n",

Quoted 45 lines
cmds-subvolume.c +4 -5
 vname);
 ret = 1;
 goto out;
@@ -722,14 +722,14 @@ static int cmd_snapshot(int argc, char **argv)
 }
 
 if (!test_issubvolname(newname)) {
- fprintf(stderr, "ERROR: incorrect snapshot name ('%s')\n",
+ fprintf(stderr, "ERROR: incorrect snapshot name '%s'\n",
 newname);
 goto out;
 }
 
 len = strlen(newname);
 if (len == 0 || len>= BTRFS_VOL_NAME_MAX) {
- fprintf(stderr, "ERROR: snapshot name too long ('%s)\n",
+ fprintf(stderr, "ERROR: snapshot name too long '%s'\n",
 newname);
 goto out;
 }
@@ -778,7 +778,7 @@ static int cmd_snapshot(int argc, char **argv)
 res = ioctl(fddst, BTRFS_IOC_SNAP_CREATE_V2, &args);
 
 if (res < 0) {
- fprintf( stderr, "ERROR: cannot snapshot %s - %s\n",
+ fprintf( stderr, "ERROR: cannot snapshot '%s' - %s\n",
 subvol_descr, strerror(errno));
 goto out;
 }
@@ -991,7 +991,7 @@ static int cmd_subvol_show(int argc, char **argv)
 
 ret = find_mount_root(fullpath, &mnt);
 if (ret < 0) {
- fprintf(stderr, "ERROR: find_mount_root failed on %s: "
+ fprintf(stderr, "ERROR: find_mount_root failed on '%s': "
 "%s\n", fullpath, strerror(-ret));
 goto out;
 }
--

1.9.3

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

#2 lore raw

Hi Kyle,

Quoted 54 lines · Kyle Gates

small wording error inline below

----------------------------------------

Quoted 50 lines

Date: Fri, 25 Jul 2014 15:17:05 +0900
From: [email protected]
To: [email protected]
Subject: [PATCH 2/2] btrfs-progs: Unify the messy error message formats

From: Satoru Takeuchi <[email protected]>

- There are many format to show snapshot name in error messages, "'%s'", "'%s", "%s", "('%s')", and "('%s)". Since it's messy, unify these to "'%s'" format.
- Fix a type: s/uncorrect/incorrect/

---
cmds-subvolume.c | 16 ++++++++--------

1 file changed, 8 insertions(+), 8 deletions(-)
cmds-subvolume.c +3 -3
index b7bfb3e..ce38503 100644
@@ -140,14 +140,14 @@ static int cmd_subvol_create(int argc, char **argv)
 dstdir = dirname(dupdir);
 
 if (!test_issubvolname(newname)) {
- fprintf(stderr, "ERROR: uncorrect subvolume name ('%s')\n",
+ fprintf(stderr, "ERROR: incorrect subvolume name '%s'\n",
 newname);
 goto out;
 }
 
 len = strlen(newname);
 if (len == 0 || len>= BTRFS_VOL_NAME_MAX) {
- fprintf(stderr, "ERROR: subvolume name('%s)\n",
+ fprintf(stderr, "ERROR: subvolume name too long '%s'\n",
 newname);
 goto out;
 }
@@ -314,7 +314,7 @@ again:
 free(cpath);
 
 if (!test_issubvolname(vname)) {
- fprintf(stderr, "ERROR: incorrect subvolume name ('%s')\n",
+ fprintf(stderr, "ERROR: incorrect subvolume name '%s'\n",
 vname);
 ret = 1;
 goto out;
@@ -322,7 +322,7 @@ again:
 
Quoted 6 lines

cmds-subvolume.c again: · line 325

Quoted 4 lines
cmds-subvolume.c +1 -1
 len = strlen(vname);
 if (len == 0 || len>= BTRFS_VOL_NAME_MAX) {
- fprintf(stderr, "ERROR: snapshot name too long ('%s)\n",
+ fprintf(stderr, "ERROR: too long snapshot name '%s'\n",

+ fprintf(stderr, "ERROR: snapshot name too long '%s'\n",

Thank you for your comment. Fixed. How about is it?

===
From 73f9847c603fbe863f072d029b1a4948a1032d6e Mon Sep 17 00:00:00 2001
From: Satoru Takeuchi <[email protected]>
Date: Fri, 25 Jul 2014 12:46:27 +0900
Subject: [PATCH] btrfs-progs: unify the format of error messages.

---
 cmds-subvolume.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
cmds-subvolume.c +8 -8
index b7bfb3e..5a99c94 100644
@@ -140,14 +140,14 @@ static int cmd_subvol_create(int argc, char **argv)
 	dstdir = dirname(dupdir);
 
 	if (!test_issubvolname(newname)) {
-		fprintf(stderr, "ERROR: uncorrect subvolume name ('%s')\n",
+		fprintf(stderr, "ERROR: incorrect subvolume name '%s'\n",
 			newname);
 		goto out;
 	}
 
 	len = strlen(newname);
 	if (len == 0 || len >= BTRFS_VOL_NAME_MAX) {
-		fprintf(stderr, "ERROR: subvolume name too long ('%s)\n",
+		fprintf(stderr, "ERROR: subvolume name too long '%s'\n",
 			newname);
 		goto out;
 	}
@@ -314,7 +314,7 @@ again:
 	free(cpath);
 
 	if (!test_issubvolname(vname)) {
-		fprintf(stderr, "ERROR: incorrect subvolume name ('%s')\n",
+		fprintf(stderr, "ERROR: incorrect subvolume name '%s'\n",
 			vname);
 		ret = 1;
 		goto out;
@@ -322,7 +322,7 @@ again:
 
 	len = strlen(vname);
 	if (len == 0 || len >= BTRFS_VOL_NAME_MAX) {
-		fprintf(stderr, "ERROR: snapshot name too long ('%s)\n",
+		fprintf(stderr, "ERROR: snapshot name too long '%s'\n",
 			vname);
 		ret = 1;
 		goto out;
@@ -722,14 +722,14 @@ static int cmd_snapshot(int argc, char **argv)
 	}
 
 	if (!test_issubvolname(newname)) {
-		fprintf(stderr, "ERROR: incorrect snapshot name ('%s')\n",
+		fprintf(stderr, "ERROR: incorrect snapshot name '%s'\n",
 			newname);
 		goto out;
 	}
 
 	len = strlen(newname);
 	if (len == 0 || len >= BTRFS_VOL_NAME_MAX) {
-		fprintf(stderr, "ERROR: snapshot name too long ('%s)\n",
+		fprintf(stderr, "ERROR: snapshot name too long '%s'\n",
 			newname);
 		goto out;
 	}
@@ -778,7 +778,7 @@ static int cmd_snapshot(int argc, char **argv)
 	res = ioctl(fddst, BTRFS_IOC_SNAP_CREATE_V2, &args);
 
 	if (res < 0) {
-		fprintf( stderr, "ERROR: cannot snapshot %s - %s\n",
+		fprintf( stderr, "ERROR: cannot snapshot '%s' - %s\n",
 			subvol_descr, strerror(errno));
 		goto out;
 	}
@@ -991,7 +991,7 @@ static int cmd_subvol_show(int argc, char **argv)
 
 	ret = find_mount_root(fullpath, &mnt);
 	if (ret < 0) {
-		fprintf(stderr, "ERROR: find_mount_root failed on %s: "
+		fprintf(stderr, "ERROR: find_mount_root failed on '%s': "
 				"%s\n", fullpath, strerror(-ret));
 		goto out;
 	}
Signature · 1 line
1.9.3
#3 lore raw

----------------------------------------

Quoted 62 lines

Date: Tue, 29 Jul 2014 11:18:17 +0900
From: [email protected]
To: [email protected]; [email protected]
Subject: Re: [PATCH 2/2] btrfs-progs: Unify the messy error message formats

Hi Kyle,

Quoted 54 lines · Kyle Gates

small wording error inline below

----------------------------------------

Quoted 50 lines

Date: Fri, 25 Jul 2014 15:17:05 +0900
From: [email protected]
To: [email protected]
Subject: [PATCH 2/2] btrfs-progs: Unify the messy error message formats

From: Satoru Takeuchi <[email protected]>

- There are many format to show snapshot name in error messages, "'%s'", "'%s", "%s", "('%s')", and "('%s)". Since it's messy, unify these to "'%s'" format.
- Fix a type: s/uncorrect/incorrect/

---
cmds-subvolume.c | 16 ++++++++--------

1 file changed, 8 insertions(+), 8 deletions(-)
cmds-subvolume.c +3 -3
index b7bfb3e..ce38503 100644
@@ -140,14 +140,14 @@ static int cmd_subvol_create(int argc, char **argv)
 dstdir = dirname(dupdir);
 
 if (!test_issubvolname(newname)) {
- fprintf(stderr, "ERROR: uncorrect subvolume name ('%s')\n",
+ fprintf(stderr, "ERROR: incorrect subvolume name '%s'\n",
 newname);
 goto out;
 }
 
 len = strlen(newname);
 if (len == 0 || len>= BTRFS_VOL_NAME_MAX) {
- fprintf(stderr, "ERROR: subvolume name('%s)\n",
+ fprintf(stderr, "ERROR: subvolume name too long '%s'\n",
 newname);
 goto out;
 }
@@ -314,7 +314,7 @@ again:
 free(cpath);
 
 if (!test_issubvolname(vname)) {
- fprintf(stderr, "ERROR: incorrect subvolume name ('%s')\n",
+ fprintf(stderr, "ERROR: incorrect subvolume name '%s'\n",
 vname);
 ret = 1;
 goto out;
@@ -322,7 +322,7 @@ again:
 
Quoted 8 lines
Quoted 6 lines

cmds-subvolume.c again:

Quoted 4 lines
cmds-subvolume.c +1 -1
 len = strlen(vname);
 if (len == 0 || len>= BTRFS_VOL_NAME_MAX) {
- fprintf(stderr, "ERROR: snapshot name too long ('%s)\n",
+ fprintf(stderr, "ERROR: too long snapshot name '%s'\n",

+ fprintf(stderr, "ERROR: snapshot name too long '%s'\n",

Thank you for your comment. Fixed. How about is it?

Yes, that looks good. Thanks.

Quoted 88 lines

===
From 73f9847c603fbe863f072d029b1a4948a1032d6e Mon Sep 17 00:00:00 2001
From: Satoru Takeuchi <[email protected]>
Date: Fri, 25 Jul 2014 12:46:27 +0900
Subject: [PATCH] btrfs-progs: unify the format of error messages.

---
cmds-subvolume.c | 16 ++++++++--------

1 file changed, 8 insertions(+), 8 deletions(-)
cmds-subvolume.c +8 -9
index b7bfb3e..5a99c94 100644
@@ -140,14 +140,14 @@ static int cmd_subvol_create(int argc, char **argv)
 dstdir = dirname(dupdir);
 
 if (!test_issubvolname(newname)) {
- fprintf(stderr, "ERROR: uncorrect subvolume name ('%s')\n",
+ fprintf(stderr, "ERROR: incorrect subvolume name '%s'\n",
 newname);
 goto out;
 }
 
 len = strlen(newname);
 if (len == 0 || len>= BTRFS_VOL_NAME_MAX) {
- fprintf(stderr, "ERROR: subvolume name too long ('%s)\n",
+ fprintf(stderr, "ERROR: subvolume name too long '%s'\n",
 newname);
 goto out;
 }
@@ -314,7 +314,7 @@ again:
 free(cpath);
 
 if (!test_issubvolname(vname)) {
- fprintf(stderr, "ERROR: incorrect subvolume name ('%s')\n",
+ fprintf(stderr, "ERROR: incorrect subvolume name '%s'\n",
 vname);
 ret = 1;
 goto out;
@@ -322,7 +322,7 @@ again:
 
 len = strlen(vname);
 if (len == 0 || len>= BTRFS_VOL_NAME_MAX) {
- fprintf(stderr, "ERROR: snapshot name too long ('%s)\n",
+ fprintf(stderr, "ERROR: snapshot name too long '%s'\n",
 vname);
 ret = 1;
 goto out;
@@ -722,14 +722,14 @@ static int cmd_snapshot(int argc, char **argv)
 }
 
 if (!test_issubvolname(newname)) {
- fprintf(stderr, "ERROR: incorrect snapshot name ('%s')\n",
+ fprintf(stderr, "ERROR: incorrect snapshot name '%s'\n",
 newname);
 goto out;
 }
 
 len = strlen(newname);
 if (len == 0 || len>= BTRFS_VOL_NAME_MAX) {
- fprintf(stderr, "ERROR: snapshot name too long ('%s)\n",
+ fprintf(stderr, "ERROR: snapshot name too long '%s'\n",
 newname);
 goto out;
 }
@@ -778,7 +778,7 @@ static int cmd_snapshot(int argc, char **argv)
 res = ioctl(fddst, BTRFS_IOC_SNAP_CREATE_V2, &args);
 
 if (res < 0) {
- fprintf( stderr, "ERROR: cannot snapshot %s - %s\n",
+ fprintf( stderr, "ERROR: cannot snapshot '%s' - %s\n",
 subvol_descr, strerror(errno));
 goto out;
 }
@@ -991,7 +991,7 @@ static int cmd_subvol_show(int argc, char **argv)
 
 ret = find_mount_root(fullpath, &mnt);
 if (ret < 0) {
- fprintf(stderr, "ERROR: find_mount_root failed on %s: "
+ fprintf(stderr, "ERROR: find_mount_root failed on '%s': "
 "%s\n", fullpath, strerror(-ret));
 goto out;
 }
--

1.9.3