Commit Graph

14 Commits

Author SHA1 Message Date
Pedro F. Giffuni
1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Sean Bruno
06f1884fa8 Implement foreign volume handling. Allows admins to view foreign metadata
and clear or import it for use.

PR:     kern/172091
Submitted by:   smh@freebsd.org
Reviewed by:    jhb@freebsd.org
MFC after:      2 weeks
2013-06-08 02:54:59 +00:00
Eitan Adler
41b8cbda7d Add __unused macros to appropriate places in order to allow building
with WARNS=6 on base gcc, gcc46, and clang

Approved by:	cperciva
MFC after:	1 week
2012-06-19 06:18:42 +00:00
Eitan Adler
bf4ec4dfab Allow users with RO privilege to the device to read the RO attributes.
PR:		bin/167302
Submitted by:	markham breitbach <markham@ssimicro.com>
Discussed with:	pjd (briefly)
Approved by:	cperciva
MFC after:	1 week
2012-06-19 06:18:37 +00:00
Doug Ambrisko
b53011f9cf MFhead_mfi r233621
Remove the magic mfi_array is 288 bytes and just use the
        sizeof the array since it is not 288 bytes.

        Change reporting of a "SYSTEM" disk to "JBOD" to match
        LSI MegaCli and firmware reporting.

        This means that fiutil command to "create jbod" is now a
        little confusing since a RAID per drive is not really what
        LSI defines JBOD to be.  This should be fixed in the future
        and support added to really create LSI JBOD and enable that
        feature on cards that support it.
2012-03-30 23:39:39 +00:00
Doug Ambrisko
1d8f043a74 Now that mfi(4) header files uses the absolute number of entries to
make the mfi_array 288 bytes, remove this magic number and the
calculations that go with it.  Use the MFI_MAX_ROW_SIZE and
sizeof(struct mfi_array) in place of the prior calculations.

Change reporting a disk as "SYSTEM" when it is a "JBOD" reported
by the firmware and MegaCli.  A JBOD appears as /dev/mfisyspd<n>.

This also means the mfiutil command to "create jbod" is now a
little confusing since a RAID per drive is not really what LSI
defines JBOD to be.  In the future mfiutil should have an option
to create real JBOD's and enable that option in RAID controllers
that support it.  In testing, it appears the RAID cache is not
used with JBOD but is with the RAID per disk.  When this is
implemented more testing should be done to determine the pro's and
con's of JBOD versus RAID per disk.

Reviewed by:	jhb
2012-03-28 18:35:07 +00:00
Xin LI
6dc3afae75 In build_volume(), check if arrays is allocated before traversing its
items.  While parsing the arrays input, it's possible that we reach the
error path before initializing the 'arrays' pointer, which in turn leads
to a NULL deference.

Submitted by:	Garrett Cooper
MFC after:	1 week
2011-11-29 08:16:14 +00:00
Ed Maste
f1e7af36c0 Avoid double free creating a new RAID with invalid command line arguments.
Submitted by:	Xin Huang <xhuang sandvine com>
Reviewed by:	rstone@
MFC after:	1 week
2011-11-23 17:02:27 +00:00
Bjoern A. Zeeb
7bbae305a1 Add global -d and -e options to either print device numbers
(usually default) or enclosure:slot information as (Exx:Sxx)
or both.

Discussed with:		jhb
Reviewed by:		jhb
Sponsored by:		Sandvine Incorporated
MFC after:		1 week
2011-06-20 21:28:50 +00:00
Bjoern A. Zeeb
375c46563c Contrary to when returning in all-good cases at the end of functions we
did not free memory (1) or close the file descriptor (2) in error cases.

Reported by:	Mark Johnston (1)
Reported by:	attilio (2)
Reviewed by:	jhb
Sponsored by:	Sandvine Incorporated
MFC after:	1 week
2011-06-09 19:52:28 +00:00
John Baldwin
3c22a809ec Handle malloc() failures more gracefully by error'ing out rather than
segfaulting.

Submitted by:	gcooper
MFC after:	1 week
2010-11-19 15:39:59 +00:00
John Baldwin
c02999d982 - Save errno values before calling warn(3) so that errors are correctly
reported.
- Use powerof2() from <sys/param.h> rather than a copy and paste version.

Submitted by:	gcooper
MFC after:	1 week
2010-10-26 19:11:09 +00:00
Randi Harper
0c019d8c6e Fix compile with -DDEBUG by using the correct mfi_pd_ref union definition
in mfireg.h.

Submitted by:	gcooper
Reviewed by:	jhb
Approved by:	cperciva (mentor)
MFC after:	1 week
2010-10-10 20:54:01 +00:00
Scott Long
763fae7918 ntroduce mfiutil, a basic utility for managing LSI SAS-RAID & Dell PERC5/6
controllers.  Controller, array, and drive status can be checked, basic
attributes can be changed, and arrays and spares can be created and deleted.
Controller firmware can also be flashed.

This does not replace MegaCLI, found in ports, as that is officially sanctioned
and supported by LSI and includes vastly more functionality.  However, mfiutil
is open source and guaranteed to provide basic functionality, which can be
especially useful if you have a problem and can't get MegaCLI to work.

Approved by:    re
Obtained from:  Yahoo! Inc.
2009-08-13 23:18:45 +00:00