From f0f8d0c121ee3258bf444d9a3d3b83ace594340f Mon Sep 17 00:00:00 2001 From: Steve Guminski Date: Wed, 12 Jul 2017 12:07:44 -0400 Subject: [PATCH] LU-5170 lfs: Standardize error messages in lfs_component_del() Error messages in lfs_component_del() are updated to a standard format. Messages are prefixed with the name of the utility and the command that caused the error. User-provided values are delimited with single quotes. Test-Parameters: trivial Signed-off-by: Steve Guminski Change-Id: I02f8b25226efbbe8bd7a96bd2495a98b8d733183 Reviewed-on: https://review.whamcloud.com/28255 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: John L. Hammond Reviewed-by: Andreas Dilger --- lustre/utils/lfs.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 53929b6..bf061f3 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -681,18 +681,22 @@ static int lfs_component_del(char *fname, __u32 comp_id, __u32 flags) /* LCME_FL_INIT is the only supported flag in PFL */ if (flags != 0) { if (flags & ~LCME_KNOWN_FLAGS) { - fprintf(stderr, "Invalid component flags %#x\n", flags); + fprintf(stderr, + "%s setstripe: bad component flags %#x\n", + progname, flags); return -EINVAL; } } else if (comp_id > LCME_ID_MAX) { - fprintf(stderr, "Invalid component id %u\n", comp_id); + fprintf(stderr, "%s setstripe: bad component id %u\n", + progname, comp_id); return -EINVAL; } rc = llapi_layout_file_comp_del(fname, comp_id, flags); if (rc) - fprintf(stderr, "Delete component %#x from %s failed. %s\n", - comp_id, fname, strerror(errno)); + fprintf(stderr, + "%s setstripe: cannot delete component %#x from '%s': %s\n", + progname, comp_id, fname, strerror(errno)); return rc; } -- 1.8.3.1