Whamcloud - gitweb
LU-5170 lfs: Standardize error messages in lfs_component_del() 55/28255/2
authorSteve Guminski <stephenx.guminski@intel.com>
Wed, 12 Jul 2017 16:07:44 +0000 (12:07 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 22 Nov 2017 03:55:04 +0000 (03:55 +0000)
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 <stephenx.guminski@intel.com>
Change-Id: I02f8b25226efbbe8bd7a96bd2495a98b8d733183
Reviewed-on: https://review.whamcloud.com/28255
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/utils/lfs.c

index 53929b6..bf061f3 100644 (file)
@@ -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;
 }