History log of /freebsd-head/sys/geom/raid/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
246370ba36c98107f1782ef761d81a4d6b33391e 01-Sep-2020 mjg <mjg@FreeBSD.org> geom: clean up empty lines in .c and .h files
_raid_ctl.c
d_ddf.c
d_intel.c
d_jmicron.c
d_nvidia.c
d_promise.c
d_sii.c
r_concat.c
r_raid1.c
r_raid1e.c
3249097b0a91c1659755bbbf122da7c99e45c3f3 09-Jul-2020 delphij <delphij@FreeBSD.org> sys/geom: consistently use _PATH_DEV instead of hardcoding "/dev/".

Reviewed by: cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25565
_raid.c
d_ddf.c
d_intel.c
d_jmicron.c
d_nvidia.c
d_promise.c
d_sii.c
ad355b0a9dbd6a8aabe7c081a731d24904a0f2c1 26-Feb-2020 kaktus <kaktus@FreeBSD.org> Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Mark all obvious cases as MPSAFE. All entries that haven't been marked
as MPSAFE before are by default marked as NEEDGIANT

Approved by: kib (mentor, blanket)
Commented by: kib, gallatin, melifaro
Differential Revision: https://reviews.freebsd.org/D23718
_raid.c
_raid.h
4aee421586df0608167b8a6d4304cade5910497d 17-Jan-2020 imp <imp@FreeBSD.org> Pass BIO_SPEEDUP through all the geom layers

While some geom layers pass unknown commands down, not all do. For the ones that
don't, pass BIO_SPEEDUP down to the providers that constittue the geom, as
applicable. No changes to vinum or virstor because I was unsure how to add this
support, and I'm also unsure how to test these. gvinum doesn't implement
BIO_FLUSH either, so it may just be poorly maintained. gvirstor is for testing
and not supportig BIO_SPEEDUP is fine.

Reviewed by: chs
Differential Revision: https://reviews.freebsd.org/D23183
_raid.c
r_concat.c
r_raid0.c
r_raid1.c
r_raid1e.c
r_raid5.c
10d53fcce8d03533ba3ded8380337cc79b974fad 07-Aug-2019 cem <cem@FreeBSD.org> GEOM: Reduce unnecessary log interleaving with sbufs

Similar to what was done for device_printfs in r347229.

Convert g_print_bio() to a thin shim around g_format_bio(), which acts on an
sbuf; documented in g_bio.9.

Reviewed by: markj
Discussed with: rlibby
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D21165
_raid.c
_raid.h
d_ddf.c
d_intel.c
d_jmicron.c
d_nvidia.c
d_promise.c
d_sii.c
r_concat.c
r_raid0.c
r_raid1.c
r_raid1e.c
6839a1dd36aa3022da6bc469f70667cb895a43a3 19-Jun-2019 mav <mav@FreeBSD.org> Use sbuf_cat() in GEOM confxml generation.

When it comes to megabytes of text, difference between sbuf_printf() and
sbuf_cat() becomes substantial.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
_raid.c
8581c5bfb9de3f11e1f9daa843cae6dc5b1a8eae 17-Jun-2019 delphij <delphij@FreeBSD.org> Separate kernel crc32() implementation to its own header (gsb_crc32.h) and
rename the source to gsb_crc32.c.

This is a prerequisite of unifying kernel zlib instances.

PR: 229763
Submitted by: Yoshihiro Ota <ota at j.email.ne.jp>
Differential Revision: https://reviews.freebsd.org/D20193
d_ddf.c
6058a49bde83828912aa45227c3371f9c6148b01 06-May-2019 cem <cem@FreeBSD.org> List-ify kernel dump device configuration

Allow users to specify multiple dump configurations in a prioritized list.
This enables fallback to secondary device(s) if primary dump fails. E.g.,
one might configure a preference for netdump, but fallback to disk dump as a
second choice if netdump is unavailable.

This change does not list-ify netdump configuration, which is tracked
separately from ordinary disk dumps internally; only one netdump
configuration can be made at a time, for now. It also does not implement
IPv6 netdump.

savecore(8) is already capable of scanning and iterating multiple devices
from /etc/fstab or passed on the command line.

This change doesn't update the rc or loader variables 'dumpdev' in any way;
it can still be set to configure a single dump device, and rc.d/savecore
still uses it as a single device. Only dumpon(8) is updated to be able to
configure the more complicated configurations for now.

As part of revving the ABI, unify netdump and disk dump configuration ioctl
/ structure, and leave room for ipv6 netdump as a future possibility.
Backwards-compatibility ioctls are added to smooth ABI transition,
especially for developers who may not keep kernel and userspace perfectly
synced.

Reviewed by: markj, scottl (earlier version)
Relnotes: maybe
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D19996
_raid.h
b7a9839424a9a623c1da464fdc60ebf385ff59e0 02-Jan-2019 markj <markj@FreeBSD.org> Use g_handleattr() to reply to GEOM::candelete queries.

g_handleattr() fills out bp->bio_completed; otherwise, g_getattr()
returns an error in response to the query. This caused BIO_DELETE
support to not be propagated through stacked configurations, e.g.,
a gconcat of gmirror volumes would not handle BIO_DELETE even when
the gmirrors do. g_io_getattr() was not affected by the problem.

PR: 232676
Reported and tested by: noah.bergbauer@tum.de
MFC after: 1 week
_raid.c
f8a3770ab6517397834a9b5b82d209917c134481 27-Oct-2018 eugen <eugen@FreeBSD.org> Extend stripeoffset and stripesize of GEOMs from u_int to off_t

GEOM's stripeoffset overflows at 4 gigabyte margin (2^32)
because of its u_int type. This leads to incorrect data in the output
generated by "sysctl kern.geom.confxml" command, "graid list" etc.
when GEOM array has volumes larger than 4G, for example.

This change does not affect ABI but changes KBI. No MFC planned.

Differential Revision: https://reviews.freebsd.org/D13426
_raid.c
d88eb6692d2c8f5e5928d308749dbde9bfc46414 24-Sep-2018 mav <mav@FreeBSD.org> Fix use-after-free in RAID0 error reporting of GEOM_RAID.

PR: 231510
Submitted by: yangx92@hotmail.com
Approved by: re (gjb)
MFC after: 1 week
r_raid0.c
2e026938033ce5a0a5c7d8f69c54220fbcf6d4bd 05-Apr-2018 sbruno <sbruno@FreeBSD.org> Squash error from geom by sizing ident strings to DISK_IDENT_SIZE.

Display attribute in future error strings and differentiate g_handleattr()
error messages for ease of debugging in the future.

"g_handleattr: md1 bio_length 24 strlen 31 -> EFAULT"

Reported by: swills
Reviewed by: imp cem avg
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D14962
d_ddf.c
d_intel.c
c8da6fae2c8073f216b7a35739f7dfa140c9a8d9 25-Dec-2017 kan <kan@FreeBSD.org> Do pass removing some write-only variables from the kernel.

This reduces noise when kernel is compiled by newer GCC versions,
such as one used by external toolchain ports.

Reviewed by: kib, andrew(sys/arm and sys/arm64), emaste(partial), erj(partial)
Reviewed by: jhb (sys/dev/pci/* sys/kern/vfs_aio.c and sys/kern/kern_synch.c)
Differential Revision: https://reviews.freebsd.org/D10385
_raid.c
d_ddf.c
d_promise.c
r_raid5.c
748192b1b0e2987da419b3f19837bb92a2925c5c 07-Dec-2017 eugen <eugen@FreeBSD.org> geom_raid (RAID5): do not lose bp->bio_error, keep it in pbp->bio_error
and return it by passing to g_raid_iodone()

Approved by: mav (mentor)
MFC after: 3 days
r_raid5.c
5d8549519a06f03eaf2e755d88ca8bc75bef0062 07-Dec-2017 eugen <eugen@FreeBSD.org> Fix use-after-free that sometimes results in a garbage returned
instead of right error code after requests to SINGLE/CONCAT volumes, f.e:

# dd if=/dev/raid/r0 bs=512 of=/dev/null
dd: /dev/raid/r0: Unknown error: -559038242

Reviewed by: avg (mentor), mav (mentor)
MFC after: 3 days
r_concat.c
a82e3a8b2430553d1a48209e110921023d727e45 27-Nov-2017 pfg <pfg@FreeBSD.org> sys/geom: 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.
_raid.c
_raid.h
_raid_ctl.c
d_ddf.c
d_ddf.h
d_intel.c
d_jmicron.c
d_nvidia.c
d_promise.c
d_sii.c
r_concat.c
r_raid0.c
r_raid1.c
r_raid1e.c
r_raid5.c
71cd794fea9c05c313ae6b50d8b13dbdd80d288a 12-Jan-2017 cem <cem@FreeBSD.org> g_raid: Prevent tasters from attempting excessively large reads

Some g_raid tasters attempt metadata reads in multiples of the provider
sectorsize. Reads larger than MAXPHYS are invalid, so detect and abort
in such situations.

Spiritually similar to r217305 / PR 147851.

PR: 214721
Sponsored by: Dell EMC Isilon
d_ddf.c
d_promise.c
30f99dbeefc844112679b1d34c674426abfb24c8 08-Nov-2016 bdrewery <bdrewery@FreeBSD.org> Fix improper use of "its".

Sponsored by: Dell EMC Isilon
d_ddf.c
d_intel.c
d_jmicron.c
d_nvidia.c
d_promise.c
d_sii.c
f05c84067d712ad6179a868d16fa8271b44c6b07 20-May-2016 kib <kib@FreeBSD.org> Removal of Giant droping wrappers for GEOM classes.

Sponsored by: The FreeBSD Foundation
_raid.c
fafa173c2881090a0d7e8a5d53f8bc2b1a81d77e 29-Apr-2016 pfg <pfg@FreeBSD.org> sys/geom: spelling fixes in comments.

No functional change.
r_raid1.c
r_raid1e.c
586d106e191628e927b30d43c75a8684094fe6e6 28-Apr-2016 pfg <pfg@FreeBSD.org> sys/geom: spelling fixes.

These affect debugging messages.

MFC after: 2 weeks
_raid_ctl.c
d_ddf.c
863c16cbbd6f420e941fb932ad2743db9e333f19 27-Apr-2016 pfg <pfg@FreeBSD.org> geom: unsign some types to match their definitions and avoid overflows.

In struct:gctl_req, nargs is unsigned.

In mirror:
g_mirror_syncreqs is unsigned.

In raid:
in struct:g_raid_volume, v_disks_count is unsigned.

In virstor:
in struct:g_virstor_softc, n_components is unsigned.

MFC after: 2 weeks
d_promise.c
d_sii.c
fc01419148d065603607b1008d536431465f3bc3 26-Apr-2016 pfg <pfg@FreeBSD.org> sys: extend use of the howmany() macro when available.

We have a howmany() macro in the <sys/param.h> header that is
convenient to re-use as it makes things easier to read.
d_ddf.c
d_intel.c
b63211eed5e20b9ad1b7649373ab39eff72e2521 10-Apr-2016 pfg <pfg@FreeBSD.org> Cleanup unnecessary semicolons from the kernel.

Found with devel/coccinelle.
d_promise.c
0bfb5dbc867a4ef73b0b2259adfd285a1cbaf5d2 17-Feb-2016 imp <imp@FreeBSD.org> Create an API to reset a struct bio (g_reset_bio). This is mandatory
for all struct bio you get back from g_{new,alloc}_bio. Temporary
bios that you create on the stack or elsewhere should use this before
first use of the bio, and between uses of the bio. At the moment, it
is nothing more than a wrapper around bzero, but that may change in
the future. The wrapper also removes one place where we encode the
size of struct bio in the KBI.
_raid.c
64d53c4c7d2401ff7f259304054800f496e26941 11-Oct-2015 mav <mav@FreeBSD.org> Remove compatibility shims for legacy ATA device names.

We got new ATA stack in FreeBSD 8.x, switched to it at 9.x, completely
removed old stack at 10.x, so at 11.x it is time to remove compat shims.
_raid.c
04e944197ed8cac9ab8ec518fc7f6d123cbb5f97 11-Aug-2015 pfg <pfg@FreeBSD.org> Clean out some externally visible "more then" grammar

MFC after: 3 days
d_intel.c
d_jmicron.c
d_nvidia.c
d_sii.c
3e52cc4fb2653937bff28751cc028a4c8e79d0d4 27-Mar-2015 mav <mav@FreeBSD.org> Remove request sorting from GEOM_MIRROR and GEOM_RAID.

When CPU is not busy, those queues are typically empty. When CPU is busy,
then one more extra sorting is the last thing it needs. If specific device
(HDD) really needs sorting, then it will be done later by CAM.

This supposed to fix livelock reported for mirror of two SSDs, when UFS
fires zillion of BIO_DELETE requests, that totally blocks I/O subsystem by
pointless sorting of requests and responses under single mutex lock.

MFC after: 2 weeks
_raid.c
15944be5bd5018ceeecc6638b05b7144b5f120b8 25-Feb-2015 mav <mav@FreeBSD.org> Replace constant with proper sizeof().

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks
d_intel.c
d_jmicron.c
d_nvidia.c
d_promise.c
d_sii.c
f68d5de62f4e8609789103416ae21048723ccd8b 05-Dec-2014 mav <mav@FreeBSD.org> Avoid unneeded malloc/memcpy/free if there is no metadata on disk.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks
d_nvidia.c
d_sii.c
173190c9f87be20e0cd6b88bad2ab4fdce0bd26f 04-Dec-2014 mav <mav@FreeBSD.org> Decode some binary fields of Intel metadata.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks
d_intel.c
e88bd26b3f101e3aad82304315f731daa60cc6de 16-Oct-2014 davide <davide@FreeBSD.org> Follow up to r225617. In order to maximize the re-usability of kernel code
in userland rename in-kernel getenv()/setenv() to kern_setenv()/kern_getenv().
This fixes a namespace collision with libc symbols.

Submitted by: kmacy
Tested by: make universe
_raid.c
35b126e324b8032aebea9ab6b4daf7c0bf8daed0 28-Jun-2014 hselasky <hselasky@FreeBSD.org> Pull in r267961 and r267973 again. Fix for issues reported will follow.
_raid.c
_raid.h
r_raid1.c
r_raid1e.c
fc21f40567ac7485e9e987cf5a539bd0d11c7155 27-Jun-2014 gjb <gjb@FreeBSD.org> Revert r267961, r267973:

These changes prevent sysctl(8) from returning proper output,
such as:

1) no output from sysctl(8)
2) erroneously returning ENOMEM with tools like truss(1)
or uname(1)
truss: can not get etype: Cannot allocate memory
_raid.c
_raid.h
r_raid1.c
r_raid1e.c
bd1ed65f0faa90d56aad3c8fc1b55d874d1548d9 27-Jun-2014 hselasky <hselasky@FreeBSD.org> Extend the meaning of the CTLFLAG_TUN flag to automatically check if
there is an environment variable which shall initialize the SYSCTL
during early boot. This works for all SYSCTL types both statically and
dynamically created ones, except for the SYSCTL NODE type and SYSCTLs
which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to
be used in the case a tunable sysctl has a custom initialisation
function allowing the sysctl to still be marked as a tunable. The
kernel SYSCTL API is mostly the same, with a few exceptions for some
special operations like iterating childrens of a static/extern SYSCTL
node. This operation should probably be made into a factored out
common macro, hence some device drivers use this. The reason for
changing the SYSCTL API was the need for a SYSCTL parent OID pointer
and not only the SYSCTL parent OID list pointer in order to quickly
generate the sysctl path. The motivation behind this patch is to avoid
parameter loading cludges inside the OFED driver subsystem. Instead of
adding special code to the OFED driver subsystem to post-load tunables
into dynamically created sysctls, we generalize this in the kernel.

Other changes:
- Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"
to "hw.pcic.intr_mask".
- Removed redundant TUNABLE statements throughout the kernel.
- Some minor code rewrites in connection to removing not needed
TUNABLE statements.
- Added a missing SYSCTL_DECL().
- Wrapped two very long lines.
- Avoid malloc()/free() inside sysctl string handling, in case it is
called to initialize a sysctl from a tunable, hence malloc()/free() is
not ready when sysctls from the sysctl dataset are registered.
- Bumped FreeBSD version to indicate SYSCTL API change.

MFC after: 2 weeks
Sponsored by: Mellanox Technologies
_raid.c
_raid.h
r_raid1.c
r_raid1e.c
b384f8775fb9dac291a6c48827c9f7c4bd2bc455 28-Apr-2014 mav <mav@FreeBSD.org> Reduce number of opens by REOM RAID during provider taste.

Instead opening/closing provider by each of metadata classes, do it only
once in core code. Since for SCSI disks open/close means sending some
SCSI commands to the device, this change reduces taste time.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
_raid.c
d_ddf.c
d_intel.c
d_jmicron.c
d_nvidia.c
d_promise.c
d_sii.c
bc9e83bd99832f56ccff013498c1ef4f5ddaec20 10-Apr-2014 mav <mav@FreeBSD.org> Fix wrong sizes used to access PD_Type and PD_State DDF metadata fields.

This caused incorrect behavior of arrays with big-endian DDF metadata.
Little-endian (like used by Adaptec controllers) should not be harmed.
Add workaround should be enough to manage compatibility.

MFC after: 2 weeks
d_ddf.c
44c01df17391f4429ee371e8039ae4fd802c2a8e 30-Nov-2013 eadler <eadler@FreeBSD.org> Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this
shifts into the sign bit. Instead use (1U << 31) which gets the
expected result.

This fix is not ideal as it assumes a 32 bit int, but does fix the issue
for most cases.

A similar change was made in OpenBSD.

Discussed with: -arch, rdivacky
Reviewed by: cperciva
r_raid1e.c
4219fc00741f40993b2047c0524fe87ad9bce077 22-Oct-2013 mav <mav@FreeBSD.org> Merge GEOM direct dispatch changes from the projects/camlock branch.

When safety requirements are met, it allows to avoid passing I/O requests
to GEOM g_up/g_down thread, executing them directly in the caller context.
That allows to avoid CPU bottlenecks in g_up/g_down threads, plus avoid
several context switches per I/O.

The defined now safety requirements are:
- caller should not hold any locks and should be reenterable;
- callee should not depend on GEOM dual-threaded concurency semantics;
- on the way down, if request is unmapped while callee doesn't support it,
the context should be sleepable;
- kernel thread stack usage should be below 50%.

To keep compatibility with GEOM classes not meeting above requirements
new provider and consumer flags added:
- G_CF_DIRECT_SEND -- consumer code meets caller requirements (request);
- G_CF_DIRECT_RECEIVE -- consumer code meets callee requirements (done);
- G_PF_DIRECT_SEND -- provider code meets caller requirements (done);
- G_PF_DIRECT_RECEIVE -- provider code meets callee requirements (request).
Capable GEOM class can set them, allowing direct dispatch in cases where
it is safe. If any of requirements are not met, request is queued to
g_up or g_down thread same as before.

Such GEOM classes were reviewed and updated to support direct dispatch:
CONCAT, DEV, DISK, GATE, MD, MIRROR, MULTIPATH, NOP, PART, RAID, STRIPE,
VFS, ZERO, ZFS::VDEV, ZFS::ZVOL, all classes based on g_slice KPI (LABEL,
MAP, FLASHMAP, etc).

To declare direct completion capability disk(9) KPI got new flag equivalent
to G_PF_DIRECT_SEND -- DISKFLAG_DIRECT_COMPLETION. da(4) and ada(4) disk
drivers got it set now thanks to earlier CAM locking work.

This change more then twice increases peak block storage performance on
systems with manu CPUs, together with earlier CAM locking changes reaching
more then 1 million IOPS (512 byte raw reads from 16 SATA SSDs on 4 HBAs to
256 user-level threads).

Sponsored by: iXsystems, Inc.
MFC after: 2 months
_raid.c
d_ddf.c
d_intel.c
d_jmicron.c
d_nvidia.c
d_promise.c
d_sii.c
bf87deb4e70f58dd3bab143860226db1a93db199 16-Oct-2013 mav <mav@FreeBSD.org> MFprojects/camlock r256445:
Add unmapped I/O support to GEOM RAID.
_raid.c
_raid.h
r_concat.c
r_raid0.c
r_raid1.c
r_raid1e.c
r_raid5.c
eba4a485b224ae259700b960fe63abf2463a33aa 13-Aug-2013 mav <mav@FreeBSD.org> Return error when opening read-only volumes (like RAID4/5/...) for writing.
Previously opens succeeded, but actual write operations returned errors.

Requested by: peter
MFC after: 2 weeks
_raid.c
_raid.h
r_raid5.c
d9e76bbffc59d724ea0ffe9896012f4ac0859bc7 13-Aug-2013 mav <mav@FreeBSD.org> Oops, wrong constant at r254269.
r_raid5.c
1ddae2c9b4daa28f2ed167d467092286bda32106 13-Aug-2013 mav <mav@FreeBSD.org> Fix reasonable but safe Clang warnings.
r_raid5.c
2b433ed7774220e85663873a45c2aa18d9f66fe0 27-Jul-2013 mav <mav@FreeBSD.org> Introduce 3 seconds timeout on `graid stop` command (mostly with -f flag).
Since completion waiting goes in g_event thread, it may cause GEOM deadlock
if consumer on top (for example, ZFS) uses g_event thread for closing.
_raid.c
_raid_ctl.c
da1d4b7e77246f92792d33f8b31ed07cf2a475fb 20-May-2013 mav <mav@FreeBSD.org> Fix vdc->Secondary_Element_Count metadata field access from 16 to 8 bit.
In some cases it could cause kernel panic during failed drive replacement.

Reported by: trasz
MFC after: 1 week
d_ddf.c
c0507568619dc28ceea42bb52443c6440398c3ae 27-Apr-2013 mav <mav@FreeBSD.org> Return "descr" field alike to "Intel RAID1 volume" for GEOM RAID to make
it look better in bsdinstall.
_raid.c
7997002b4f25acca523ed49b4579f479e8da0c77 26-Mar-2013 mav <mav@FreeBSD.org> Remove extra bio_data and bio_length copying to child request after calling
g_clone_bio(), that already copied them.
r_raid1e.c
22372779e59998ec6a0a5be2cb59b2b090af6bdc 08-Mar-2013 sbruno <sbruno@FreeBSD.org> Add legacy support to geom raid to create a /dev/arX device for support
of upgrading older machines using ataraid(4) to newer releases.

This optional parameter is controlled via kern.geom.raid.legacy_aliases
and will create a /dev/ar0 device that will point at /dev/raid/r0 for
example.

Tested on Dell SC 1425 DDF-1 format software raid controllers installing from
stable/7 and upgrading to stable/9 without having to adjust /etc/fstab

Reviewed by: mav
Obtained from: Yahoo!
MFC after: 2 Weeks
_raid.c
a1b987fb96fceedb0c447645ff9785d5cbd8cd1a 07-Mar-2013 mav <mav@FreeBSD.org> Fix panic when Secondary_Element_Count == 1 and Secondary_Element_Seq
is not set (255).

Reported by: sbruno
MFC after: 1 week
d_ddf.c
28491a8c651aa8aa23c766de5199de58b1e0cfda 17-Jan-2013 mav <mav@FreeBSD.org> - Fix rebuild position broken at r245522.
- Identify one more metadata field.
d_promise.c
d3c13df6d1c6d7707a4bcfaf5b1711c4d0621064 17-Jan-2013 mav <mav@FreeBSD.org> For Promise/AMD metadata add support for disks with capacity above 2TiB
and for volumes with sector size above 512 bytes.
d_promise.c
559b3a7eace4ecc2123bb9319d05ad25cc53599b 17-Jan-2013 mav <mav@FreeBSD.org> Recalculate volume size only for real CONCATs. For SINGLE trust volume
size given by metadata, as it should be correct and in some cases can be
smaller then subdisk size.
r_concat.c
1d08afc7e3c4418caf298c2e7e24eeb324d10811 14-Jan-2013 mav <mav@FreeBSD.org> Keep value of orig_config_id metadata field. Windows driver writes there
previous value of config_id when it is changed in some cases. I guess it
may be used do avoid some split-brain conditions.
d_intel.c
7ed3ee172aa11cd143c08046767a78f1378e8cd6 14-Jan-2013 mav <mav@FreeBSD.org> Small cosmetic tuning of the IRRT status constants.
d_intel.c
163aff2e8d27290d49539f29ea022390ed1c1875 14-Jan-2013 mav <mav@FreeBSD.org> Print some more metadata fields.
d_intel.c
257051502affd96323d9712fa882d51ff3ac4538 14-Jan-2013 mav <mav@FreeBSD.org> Windows driver writes relative volume IDs to metadata field. Use that value
as a hint for raid/rX device number to make it persistent across reboots.
d_intel.c
44f703ac3d31dd511c7634ef7390ce623d29629c 13-Jan-2013 mav <mav@FreeBSD.org> - Add checks for Intel metadata version and attributes. Ignore disks with
unsupported metadata types like Intel Smart Response to not corrupt them.
- Improve setting of these things during metadata writing to protect from
incapable BIOS'es and other implementations.
d_intel.c
6157d3ce336dcb3c28c81507cac6d3daae7d87ff 13-Jan-2013 mav <mav@FreeBSD.org> Improve support for disabled disks. If disabled disk disconnected and then
reconnected back, leave it as disconnected. If new disk inserted instead of
disabled, rebuild it and leave as enabled.
_raid.c
d_intel.c
8de7e6376516d3e9b28116150334515cc78459ed 12-Jan-2013 mav <mav@FreeBSD.org> Windows handles INIT and VERIFY as array-wide and it doesn't specify which
disks should be rebuilt. Our rebuild code is same time disk-centric. To
handle this situation properly check all disks for RBLD flags, and if no
disk specified try rebuild/resync all of them except newly inserted.
d_intel.c
960e9d02c6524420c6a138200264b33a52d5d7eb 12-Jan-2013 mav <mav@FreeBSD.org> Implement migration from single disk to RAID1/IRRT for Intel metadata.
Windows driver uses such migration when it creates new arrays. While GEOM
RAID has no mechanism to implement migration in general case, this specifc
case still can be handled easily via degraded RAID1 creation followed by
regular rebuild.
d_intel.c
2a61b082bf60afb1c45cb4c10fef641623e29664 12-Jan-2013 mav <mav@FreeBSD.org> Add basic support for Intel Rapid Recover Technology (Intel RRT).
It is alike to RAID1, but with dedicating master and recovery disks and
providing manual control over synchronization. It allows to use recovery
disk as snapshot of the master disk from the time of the last sync.

This implementation is not functionaly complete comparing to Windows,
but it is better then silent conversion to RAID1 on first boot.
_raid.c
_raid.h
d_intel.c
d77bd5cf53f64f6067318e90b23004dae55a373b 29-Oct-2012 mav <mav@FreeBSD.org> Minor addition to r242323:
Alike to BIO_WRITE, report success if at least one subdisk succeeded with
BIO_DELETE. But unlike BIO_WRITE don't fail disk on BIO_DELETE error.

Sponsored by: iXsystems, Inc.
MFC after: 1 month
r_raid1.c
r_raid1e.c
a43d540d9efdfd22157e434662f6be55d1437f32 29-Oct-2012 mav <mav@FreeBSD.org> Add basic BIO_DELETE support to GEOM RAID class for all RAID levels.

If at least one subdisk in the volume supports it, BIO_DELETE requests
will be propagated down. Unfortunatelly, for RAID levels with redundancy
unmapped blocks will be mapped back during first rebuild/resync process.

Sponsored by: iXsystems, Inc.
MFC after: 1 month
_raid.c
_raid.h
d_ddf.c
d_intel.c
d_jmicron.c
d_nvidia.c
d_promise.c
d_sii.c
r_concat.c
r_raid0.c
r_raid1.c
r_raid1e.c
fa229bcba8f49eaaba2a69f57bb4ebac95387d92 29-Oct-2012 mav <mav@FreeBSD.org> Make GEOM RAID more aggressive in marking volumes as clean on shutdown
and move that action from shutdown_pre_sync to shutdown_post_sync stage
to avoid extra flapping.

ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID
to shutdown gracefully. To handle that, mark volume as clean just when
shutdown time comes and there are no active writes.

MFC after: 2 weeks
_raid.c
7849b3fa4d9df854109e7ad2d649585d459a0176 10-Oct-2012 mav <mav@FreeBSD.org> NULL-ify last previously used pointer instead of last possible pointer.
This should be only a cosmetic change.

Found by: Clang Static Analyzer
d_promise.c
bfb53c205cc5070309c8d61379cb48a0522ecade 07-Oct-2012 mav <mav@FreeBSD.org> Make graid command line a bit more friendly by allowing volume name or
provider name to be specified instead of geom name (first argument in all
subcommands except label). In most cases there is only one array used
any way, so it is not really useful to make user type ugly geom names like
Intel-f0bdf223 or SiI-732c2b9448cf. Though they can be used in some cases.

Sponsored by: iXsystems, Inc.
MFC after: 1 month
_raid_ctl.c
d_ddf.c
d_intel.c
d_promise.c
db9e01aca9af40e4b56657bc713041a28462e06b 13-Sep-2012 mav <mav@FreeBSD.org> Add global and per-module sysctls/tunables to enable/disable metadata taste.
That should help to handle some cases when disk has some RAID metadata that
should be ignored, especially during boot.

MFC after: 3 days
_raid.c
_raid.h
d_ddf.c
d_intel.c
d_jmicron.c
d_nvidia.c
d_promise.c
d_sii.c
r_concat.c
r_raid0.c
r_raid1.c
r_raid1e.c
r_raid5.c
9c79bfbda2957861d5be3c798c89ac6fee664d87 10-Aug-2012 mav <mav@FreeBSD.org> Add missing FAILED event to g_raid_subdisk_event2str() to print it properly
in debug messages.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
_raid.c
7e5e00e55fff2185e28629da87dec0d8a84aebe0 11-May-2012 mav <mav@FreeBSD.org> - Prevent error status leak if write to some of the RAID1/1E volume disks
failed while write to some other succeeded. Instead mark disk as failed.
- Make RAID1E less aggressive in failing disks to avoid volume breakage.

MFC after: 2 weeks
r_raid1.c
r_raid1e.c
64e3d8819be3cb969d4d2ac00804ddd38ae320cf 06-May-2012 mav <mav@FreeBSD.org> Remove some hardcoded constants from code.
d_ddf.c
6710f450f7a9e9efe9980ca61ce3d87b66627ea4 06-May-2012 mav <mav@FreeBSD.org> Plug small memory leaks.
d_ddf.c
d_promise.c
3d44dd0fea21a2108201e4e627a1ebb119cebdd4 06-May-2012 mav <mav@FreeBSD.org> Add support for RAID5R. Slightly improve support for RAIDMDF.
_raid.c
_raid.h
d_ddf.c
r_raid5.c
3f57d6ecd5469f6795c7306903247ca8bba1a12d 04-May-2012 mav <mav@FreeBSD.org> Fix bug causing memory corruption and panics with big-endian metadata.
d_ddf.c
4ed58415ed0f9cdf641d6979a484225919000900 04-May-2012 mav <mav@FreeBSD.org> Implement read-only support for volumes in optimal state (without using
redundancy) for the following RAID levels: RAID4/5E/5EE/6/MDF.
_raid.c
r_raid5.c
6a0688c8fd793f12e94493c122206163820eeff4 03-May-2012 mav <mav@FreeBSD.org> Add optional -o argument to the `graid label ` to specify some metadata
format options. Use it for specifying byte order for the DDF metadata:
big-endian defined by specification and little-endian used by Adaptec.
_raid.c
_raid.h
_raid_ctl.c
_raid_md_if.m
d_ddf.c
ecf215ed8d6ad3a4ddceabaa8e5c02c4774d1320 01-May-2012 mav <mav@FreeBSD.org> Improve spare disks support. Unluckily, for some reason Adaptec 1430SA
RAID BIOS doesn't want to understand spare disks created by graid. But
at least spares created by BIOS are working fine now.
d_ddf.c
08b90a5b47616790b430cf96b814ac353d03ab53 01-May-2012 mav <mav@FreeBSD.org> Implement volume deletion if disk has more then one partition.
d_ddf.c
3a7fb06834aafafa8754109ea3659317424a3bb2 01-May-2012 mav <mav@FreeBSD.org> Improve DDF metadata writing.
d_ddf.c
dbcc3abc523ff7cb6a79aff875fce65fdb715261 30-Apr-2012 mav <mav@FreeBSD.org> Add to GEOM RAID class module, supporting the DDF metadata format, as
defined by the SNIA Common RAID Disk Data Format Specification v2.0.

Supports multiple volumes per array and multiple partitions per disk.
Supports standard big-endian and Adaptec's little-endian byte ordering.
Supports all single-layer RAID levels. Dual-layer RAID levels except
RAID10 are not supported now because of GEOM RAID design limitations.

Some work is still to be done, but the present code already manages basic
interoperation with RAID BIOS of the Adaptec 1430SA SATA RAID controller.

MFC after: 1 month
Sponsored by: iXsystems, Inc.
d_ddf.c
d_ddf.h
1781eecdcd7b19cac0f17520144ae08d3a9a01ab 29-Apr-2012 mav <mav@FreeBSD.org> s/gmirror/graid/
_raid.c
27867e6fc973bc518294dce41f6fd8add4e97dcf 27-Apr-2012 mav <mav@FreeBSD.org> Fix RAID5 level names changed at r234603.
d_intel.c
d_jmicron.c
d_nvidia.c
d_promise.c
d_sii.c
511879d765f49a08d94b1c36c36ef744d51b1ef8 23-Apr-2012 mav <mav@FreeBSD.org> Fix copy-paste typo in r234603.

Submitted by: kan
_raid.c
2e83ed7d1307db3a45a6e36835ccaf391564892f 23-Apr-2012 mav <mav@FreeBSD.org> Add names for all primary RAID levels defined by DDF 2.0 specification.
_raid.c
_raid.h
r_raid1.c
r_raid1e.c
c283985a30228d16a933ebadb71100f65caede2a 23-Apr-2012 mav <mav@FreeBSD.org> Add sos@ copyrights to RAID metadata modules, respecting his efforts in
decoding metadata formats in ataraid(4) code.
d_intel.c
d_jmicron.c
d_nvidia.c
d_promise.c
d_sii.c
fdb56713f24f9603c0b1d9d04f819a450c247a91 19-Apr-2012 mav <mav@FreeBSD.org> Add to GEOM RAID class module for reading non-degraded RAID5 volumes and
some environment to differentiate 4 possible RAID5 on-disk layouts.

Tested with Intel and AMD RAID BIOSes.

MFC after: 2 weeks
_raid.c
_raid.h
d_intel.c
d_jmicron.c
d_nvidia.c
d_promise.c
d_sii.c
r_raid5.c
7b24e933235fed8644759a8a95994a3e22dd0c2e 09-Jan-2012 jimharris <jimharris@FreeBSD.org> Add support for >2TB disks in GEOM RAID for Intel metadata format.

Reviewed by: mav
Approved by: scottl
MFC after: 1 week
d_intel.c
0c56cf839d3e773173db46a972d3792e8a36820d 07-Nov-2011 ed <ed@FreeBSD.org> Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.

The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.
r_raid1.c
r_raid1e.c
a4f906fd74b17750c944eb3293e7c0fcf5698f46 26-Oct-2011 mav <mav@FreeBSD.org> Clarify disks/volumes above 2TiB support in geom_raid:
- add support for volumes above 2TiB with Promise metadata format;
- enforse and document other limitations:
- Intel and Promise metadata formats do not support disks above 2TiB;
- NVIDIA metadata format does not support volumes above 2TiB.

Sponsored by: iXsystems, Inc.
MFC after: 2 weeks
d_intel.c
d_nvidia.c
d_promise.c
972deb0b1f84a778df634f7aa995aca2b570beff 11-Jul-2011 ae <ae@FreeBSD.org> Include sys/sbuf.h directly.

Reviewed by: pjd
_raid.c
0bbb5b8e1ab919b4d265f1857ccd42679a2cb39c 18-Apr-2011 mav <mav@FreeBSD.org> Reduce geom_raid log verbosity.
_raid.c
f19e4d3eda530abfc8bd12478bf6c2d358bb8e63 31-Mar-2011 mav <mav@FreeBSD.org> Bunch of small bugfixes and cleanups.

Found with: Clang Static Analyzer
_raid.c
d_intel.c
d_jmicron.c
d_nvidia.c
d_promise.c
d_sii.c
r_raid1.c
r_raid1e.c
8fca35a71a67ff324340e8a89c496eaef25f985a 31-Mar-2011 mav <mav@FreeBSD.org> Bunch of small bugfixes and cleanups.

Found with: Coverity Prevent(tm)
CID: 9656, 9658, 9693, 9705, 9706, 9707, 9808, 9809, 9810,
9711, 9712, 9713, 9714
d_intel.c
d_jmicron.c
d_nvidia.c
d_promise.c
d_sii.c
r_raid1.c
8dab5b050118631ed065f01515a1e2617f8e98de 24-Mar-2011 mav <mav@FreeBSD.org> MFgraid/head:
Add new RAID GEOM class, that is going to replace ataraid(4) in supporting
various BIOS-based software RAIDs. Unlike ataraid(4) this implementation
does not depend on legacy ata(4) subsystem and can be used with any disk
drivers, including new CAM-based ones (ahci(4), siis(4), mvs(4), ata(4)
with `options ATA_CAM`). To make code more readable and extensible, this
implementation follows modular design, including core part and two sets
of modules, implementing support for different metadata formats and RAID
levels.

Support for such popular metadata formats is now implemented:
Intel, JMicron, NVIDIA, Promise (also used by AMD/ATI) and SiliconImage.

Such RAID levels are now supported:
RAID0, RAID1, RAID1E, RAID10, SINGLE, CONCAT.

For any all of these RAID levels and metadata formats this class supports
full cycle of volume operations: reading, writing, creation, deletion,
disk removal and insertion, rebuilding, dirty shutdown detection
and resynchronization, bad sector recovery, faulty disks tracking,
hot-spare disks. For Intel and Promise formats there is support multiple
volumes per disk set.

Look graid(8) manual page for additional details.

Co-authored by: imp
Sponsored by: Cisco Systems, Inc. and iXsystems, Inc.
_raid.c
_raid.h
_raid_ctl.c
_raid_md_if.m
_raid_tr_if.m
d_intel.c
d_jmicron.c
d_nvidia.c
d_promise.c
d_sii.c
r_concat.c
r_raid0.c
r_raid1.c
r_raid1e.c