summaryrefslogtreecommitdiffstats
path: root/sys/geom/raid
Commit message (Collapse)AuthorAgeFilesLines
* Removal of Giant droping wrappers for GEOM classes.kib2016-05-201-2/+0
| | | | Sponsored by: The FreeBSD Foundation
* sys/geom: spelling fixes in comments.pfg2016-04-292-4/+4
| | | | No functional change.
* sys/geom: spelling fixes.pfg2016-04-282-4/+4
| | | | | | These affect debugging messages. MFC after: 2 weeks
* geom: unsign some types to match their definitions and avoid overflows.pfg2016-04-272-2/+2
| | | | | | | | | | | | | | | 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
* sys: extend use of the howmany() macro when available.pfg2016-04-262-32/+32
| | | | | We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read.
* Cleanup unnecessary semicolons from the kernel.pfg2016-04-101-1/+1
| | | | Found with devel/coccinelle.
* Create an API to reset a struct bio (g_reset_bio). This is mandatoryimp2016-02-171-1/+1
| | | | | | | | | 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.
* Remove compatibility shims for legacy ATA device names.mav2015-10-111-20/+0
| | | | | 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.
* Clean out some externally visible "more then" grammarpfg2015-08-114-4/+4
| | | | MFC after: 3 days
* Remove request sorting from GEOM_MIRROR and GEOM_RAID.mav2015-03-271-3/+3
| | | | | | | | | | | | 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
* Replace constant with proper sizeof().mav2015-02-255-10/+10
| | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 2 weeks
* Avoid unneeded malloc/memcpy/free if there is no metadata on disk.mav2014-12-052-10/+12
| | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 2 weeks
* Decode some binary fields of Intel metadata.mav2014-12-041-8/+115
| | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 2 weeks
* Follow up to r225617. In order to maximize the re-usability of kernel codedavide2014-10-161-1/+1
| | | | | | | | 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
* Pull in r267961 and r267973 again. Fix for issues reported will follow.hselasky2014-06-284-53/+22
|
* Revert r267961, r267973:gjb2014-06-274-22/+53
| | | | | | | | | | 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
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifhselasky2014-06-274-53/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Reduce number of opens by REOM RAID during provider taste.mav2014-04-287-20/+25
| | | | | | | | | 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.
* Fix wrong sizes used to access PD_Type and PD_State DDF metadata fields.mav2014-04-101-17/+39
| | | | | | | | 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
* Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thiseadler2013-11-301-3/+3
| | | | | | | | | | | | | 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
* Merge GEOM direct dispatch changes from the projects/camlock branch.mav2013-10-227-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* MFprojects/camlock r256445:mav2013-10-167-61/+90
| | | | Add unmapped I/O support to GEOM RAID.
* Return error when opening read-only volumes (like RAID4/5/...) for writing.mav2013-08-133-1/+8
| | | | | | | Previously opens succeeded, but actual write operations returned errors. Requested by: peter MFC after: 2 weeks
* Oops, wrong constant at r254269.mav2013-08-131-1/+1
|
* Fix reasonable but safe Clang warnings.mav2013-08-131-2/+6
|
* Introduce 3 seconds timeout on `graid stop` command (mostly with -f flag).mav2013-07-272-11/+8
| | | | | 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.
* Fix vdc->Secondary_Element_Count metadata field access from 16 to 8 bit.mav2013-05-201-1/+1
| | | | | | | In some cases it could cause kernel panic during failed drive replacement. Reported by: trasz MFC after: 1 week
* Return "descr" field alike to "Intel RAID1 volume" for GEOM RAID to makemav2013-04-271-0/+4
| | | | it look better in bsdinstall.
* Remove extra bio_data and bio_length copying to child request after callingmav2013-03-261-2/+0
| | | | g_clone_bio(), that already copied them.
* Add legacy support to geom raid to create a /dev/arX device for supportsbruno2013-03-081-0/+22
| | | | | | | | | | | | | | | 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
* Fix panic when Secondary_Element_Count == 1 and Secondary_Element_Seqmav2013-03-071-1/+4
| | | | | | | is not set (255). Reported by: sbruno MFC after: 1 week
* - Fix rebuild position broken at r245522.mav2013-01-171-2/+5
| | | | - Identify one more metadata field.
* For Promise/AMD metadata add support for disks with capacity above 2TiBmav2013-01-171-55/+91
| | | | and for volumes with sector size above 512 bytes.
* Recalculate volume size only for real CONCATs. For SINGLE trust volumemav2013-01-171-1/+2
| | | | | size given by metadata, as it should be correct and in some cases can be smaller then subdisk size.
* Keep value of orig_config_id metadata field. Windows driver writes theremav2013-01-141-2/+5
| | | | | previous value of config_id when it is changed in some cases. I guess it may be used do avoid some split-brain conditions.
* Small cosmetic tuning of the IRRT status constants.mav2013-01-141-4/+7
|
* Print some more metadata fields.mav2013-01-141-6/+12
|
* Windows driver writes relative volume IDs to metadata field. Use that valuemav2013-01-141-1/+2
| | | | as a hint for raid/rX device number to make it persistent across reboots.
* - Add checks for Intel metadata version and attributes. Ignore disks withmav2013-01-131-7/+41
| | | | | | 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.
* Improve support for disabled disks. If disabled disk disconnected and thenmav2013-01-132-21/+23
| | | | | reconnected back, leave it as disconnected. If new disk inserted instead of disabled, rebuild it and leave as enabled.
* Windows handles INIT and VERIFY as array-wide and it doesn't specify whichmav2013-01-121-2/+15
| | | | | | 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.
* Implement migration from single disk to RAID1/IRRT for Intel metadata.mav2013-01-121-6/+48
| | | | | | | 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.
* Add basic support for Intel Rapid Recover Technology (Intel RRT).mav2013-01-123-20/+102
| | | | | | | | | 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.
* Minor addition to r242323:mav2012-10-292-4/+4
| | | | | | | | 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
* Add basic BIO_DELETE support to GEOM RAID class for all RAID levels.mav2012-10-2912-173/+91
| | | | | | | | | 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
* Make GEOM RAID more aggressive in marking volumes as clean on shutdownmav2012-10-291-17/+20
| | | | | | | | | | | 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
* NULL-ify last previously used pointer instead of last possible pointer.mav2012-10-101-3/+3
| | | | | | This should be only a cosmetic change. Found by: Clang Static Analyzer
* Make graid command line a bit more friendly by allowing volume name ormav2012-10-074-12/+83
| | | | | | | | | | 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
* Add global and per-module sysctls/tunables to enable/disable metadata taste.mav2012-09-1313-31/+70
| | | | | | | That should help to handle some cases when disk has some RAID metadata that should be ignored, especially during boot. MFC after: 3 days
* Add missing FAILED event to g_raid_subdisk_event2str() to print it properlymav2012-08-101-0/+2
| | | | | | in debug messages. Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
OpenPOWER on IntegriCloud