lpfc: Fix provide host name and OS name in RSNN-NN FC-GS command
authorJames Smart <james.smart@emulex.com>
Tue, 7 Apr 2015 19:07:18 +0000 (15:07 -0400)
committerJames Bottomley <JBottomley@Odin.com>
Fri, 10 Apr 2015 14:48:45 +0000 (07:48 -0700)
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/lpfc/lpfc_ct.c

index 61a32cd23f79e708157f0fb8a9c8204a00329bbb..5fb431a51588713d2997ffbd3621d1ee69b9a3bf 100644 (file)
@@ -1074,8 +1074,25 @@ lpfc_vport_symbolic_node_name(struct lpfc_vport *vport, char *symbol,
 
        lpfc_decode_firmware_rev(vport->phba, fwrev, 0);
 
-       n = snprintf(symbol, size, "Emulex %s FV%s DV%s",
-               vport->phba->ModelName, fwrev, lpfc_release_version);
+       n = snprintf(symbol, size, "Emulex %s", vport->phba->ModelName);
+
+       if (size < n)
+               return n;
+       n += snprintf(symbol + n, size - n, " FV%s", fwrev);
+
+       if (size < n)
+               return n;
+       n += snprintf(symbol + n, size - n, " DV%s", lpfc_release_version);
+
+       if (size < n)
+               return n;
+       n += snprintf(symbol + n, size - n, " HN:%s", init_utsname()->nodename);
+
+       /* Note :- OS name is "Linux" */
+       if (size < n)
+               return n;
+       n += snprintf(symbol + n, size - n, " OS:%s", init_utsname()->sysname);
+
        return n;
 }