Skip to contentSkip to conversation

xfs_io: prefix dedupe command error messages consistently

PATCH In review Darrick J. Wong 2 participants 3 messages Dec 19, 2016 – Dec 20, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs_io: prefix dedupe command error messages consistently

Prefix the perror output of the dedupe command consistently. All the other perror calls reference the ioctl name directly, so we might as well do that for all the dedupe cases.

---
 io/reflink.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
io/reflink.c +2 -2
index d4c745c..dde26b8 100644
@@ -79,12 +79,12 @@ dedupe_ioctl(
 			goto done;
 		}
 		if (info->status < 0) {
-			fprintf(stderr, "dedupe: %s\n",
+			fprintf(stderr, "XFS_IOC_FILE_EXTENT_SAME: %s\n",
 					_(strerror(-info->status)));
 			goto done;
 		}
 		if (info->status == XFS_EXTENT_DATA_DIFFERS) {
-			fprintf(stderr, "dedupe: %s\n",
+			fprintf(stderr, "XFS_IOC_FILE_EXTENT_SAME: %s\n",
 					_("Extents did not match."));
 			goto done;
 		}
#1 lore raw
Quoted 3 lines · Darrick J. Wong

Prefix the perror output of the dedupe command consistently. All the other perror calls reference the ioctl name directly, so we might as well do that for all the dedupe cases.

I guess it's fine - technically, these aren't perrors. :)

and there are plenty of places like this too, though:

       } else if (xfsctl(name, file->fd, FS_IOC_FSGETXATTR, &attr) < 0) {
                fprintf(stderr, _("%s: cannot get flags on %s: %s\n"),
                        progname, name, strerror(errno));

as well. I'd probably argue for an actual ioctl error to include the ioctl name, but the "eh, can't dedupe" message to be a bit more friendly (i.e. "dedupe: ...") - but I may be bikeshedding too much?

-Eric

Quoted 29 lines
---
 io/reflink.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
io/reflink.c +2 -3
index d4c745c..dde26b8 100644
@@ -79,12 +79,12 @@ dedupe_ioctl(
 			goto done;
 		}
 		if (info->status < 0) {
-			fprintf(stderr, "dedupe: %s\n",
+			fprintf(stderr, "XFS_IOC_FILE_EXTENT_SAME: %s\n",
 					_(strerror(-info->status)));
 			goto done;
 		}
 		if (info->status == XFS_EXTENT_DATA_DIFFERS) {
-			fprintf(stderr, "dedupe: %s\n",
+			fprintf(stderr, "XFS_IOC_FILE_EXTENT_SAME: %s\n",
 					_("Extents did not match."));
 			goto done;
 		}
--

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

Reviewed-by on v1 1/1
#2 lore raw
In reply to Darrick J. Wong
Quoted 5 lines · Darrick J. Wong

Prefix the perror output of the dedupe command consistently. All the other perror calls reference the ioctl name directly, so we might as well do that for all the dedupe cases.

ok, after some offline discussion, *shrug* this is fine.

Quoted 28 lines
---
 io/reflink.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
io/reflink.c +2 -3
index d4c745c..dde26b8 100644
@@ -79,12 +79,12 @@ dedupe_ioctl(
 			goto done;
 		}
 		if (info->status < 0) {
-			fprintf(stderr, "dedupe: %s\n",
+			fprintf(stderr, "XFS_IOC_FILE_EXTENT_SAME: %s\n",
 					_(strerror(-info->status)));
 			goto done;
 		}
 		if (info->status == XFS_EXTENT_DATA_DIFFERS) {
-			fprintf(stderr, "dedupe: %s\n",
+			fprintf(stderr, "XFS_IOC_FILE_EXTENT_SAME: %s\n",
 					_("Extents did not match."));
 			goto done;
 		}
--

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