Upgraded to 9.2-RELEASE on Nov. 29, 2013. Have an LSI-2108-based raid controller supported without issues by mfi(4). Prior to upgrade 'mfiutil show drives' showed drive sizes correctly. After upgrade the output became like this 0 ( 0.0) ONLINE <[redacted] serial=[redacted]> SATA E1:S4 I.e., drive size was reported to be 0.0. All other aspects of mfi(4) that I have tested so far seem to work fine, as they did before. Fix: Traced the problem to usr.sbin/mfiutil/mfi_show.c file, function print_pd. It makes a call to humanize_number(3) from libutil and supplies a 256-byte buffer named 'buf' to be filled for this purpose. Then prints it with format string '%6s' which results in this incorrect behavior. Just using a 6-byte buffer, supplying it to humanize_number(3), and printing it fixes the problem. As seen in the other function print_ld in the same source file. This bug has been introduced as the larger sized 'buf' was added to source to allow for formatting status messages for foreign configurations present in the array, a new mfiutil functionality. Patch attached with submission follows: How-To-Repeat: Any run of 'mfiutil show drives' reproduces the problem. I use 3 TB drives connected to the controller but the problem is unaffected by drive size.
Responsible Changed From-To: freebsd-amd64->freebsd-bugs reclassify.
----- Forwarded message from John Baldwin <jhb@freebsd.org> ----- Date: Mon, 2 Dec 2013 15:46:03 -0500 From: John Baldwin <jhb@freebsd.org> To: freebsd-amd64@freebsd.org Cc: linimon@freebsd.org, freebsd-bugs@freebsd.org, Sean Bruno <sbruno@freebsd.org> Subject: Re: bin/184405: [regression] [patch] mfiutil(8): 'mfiutil show drives' from 9.2-REL shows 0.0 size for all drives User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) Sean, can you take care of this since you committed the foreign config stuff? I think you can simply replace sizeof(buf) in the call to humanize_number with 6 instead rather than using a separate array for the size as in the patch. -- John Baldwin ----- End forwarded message -----
Responsible Changed From-To: freebsd-bugs->sbruno by suggestion of jhb.
Author: sbruno Date: Wed Dec 4 00:28:44 2013 New Revision: 258901 URL: http://svnweb.freebsd.org/changeset/base/258901 Log: svn r251516 resized the buf argument a bit too much. Pass a hardcoded size of 6 to humanize_number() to resolve this. PR: 184405 Submitted by: jhb MFC after: 2 weeks Modified: head/usr.sbin/mfiutil/mfi_show.c Modified: head/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_show.c Wed Dec 4 00:10:37 2013 (r258900) +++ head/usr.sbin/mfiutil/mfi_show.c Wed Dec 4 00:28:44 2013 (r258901) @@ -320,7 +320,7 @@ print_pd(struct mfi_pd_info *info, int s const char *s; char buf[256]; - humanize_number(buf, sizeof(buf), info->raw_size * 512, "", + humanize_number(buf, 6, info->raw_size * 512, "", HN_AUTOSCALE, HN_B | HN_NOSPACE |HN_DECIMAL); printf("(%6s) ", buf); if (info->state.ddf.v.pd_type.is_foreign) { _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Author: sbruno Date: Sun Jan 5 17:29:53 2014 New Revision: 260324 URL: http://svnweb.freebsd.org/changeset/base/260324 Log: MFC r258901: svn r251516 resized the buf argument a bit too much. Pass a hardcoded size of 6 to humanize_number() to resolve this. PR: bin/184405 Submitted by: jhb Modified: stable/10/usr.sbin/mfiutil/mfi_show.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- stable/10/usr.sbin/mfiutil/mfi_show.c Sun Jan 5 16:45:34 2014 (r260323) +++ stable/10/usr.sbin/mfiutil/mfi_show.c Sun Jan 5 17:29:53 2014 (r260324) @@ -320,7 +320,7 @@ print_pd(struct mfi_pd_info *info, int s const char *s; char buf[256]; - humanize_number(buf, sizeof(buf), info->raw_size * 512, "", + humanize_number(buf, 6, info->raw_size * 512, "", HN_AUTOSCALE, HN_B | HN_NOSPACE |HN_DECIMAL); printf("(%6s) ", buf); if (info->state.ddf.v.pd_type.is_foreign) { _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Author: sbruno Date: Sun Jan 5 17:33:10 2014 New Revision: 260325 URL: http://svnweb.freebsd.org/changeset/base/260325 Log: MFC r258901: svn r251516 resized the buf argument a bit too much. Pass a hardcoded size of 6 to humanize_number() to resolve this. PR: bin/184405 Submitted by: jhb Modified: stable/9/usr.sbin/mfiutil/mfi_show.c Directory Properties: stable/9/usr.sbin/mfiutil/ (props changed) Modified: stable/9/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- stable/9/usr.sbin/mfiutil/mfi_show.c Sun Jan 5 17:29:53 2014 (r260324) +++ stable/9/usr.sbin/mfiutil/mfi_show.c Sun Jan 5 17:33:10 2014 (r260325) @@ -320,7 +320,7 @@ print_pd(struct mfi_pd_info *info, int s const char *s; char buf[256]; - humanize_number(buf, sizeof(buf), info->raw_size * 512, "", + humanize_number(buf, 6, info->raw_size * 512, "", HN_AUTOSCALE, HN_B | HN_NOSPACE |HN_DECIMAL); printf("(%6s) ", buf); if (info->state.ddf.v.pd_type.is_foreign) { _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed MFC to stable/9 and stable/10 complete
*** Bug 186835 has been marked as a duplicate of this bug. ***