summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Typo. BIOC_SSOFFLINE is the ioctl command. Pass BIOC_SDOFFLINE tokrw2011-11-081-2/+2
| | | | | | sd_set_chunk_state() as the new state. ok jsing@
* If the rootduid matches a softraid chunk of a bootable softraid volume,jsing2011-09-191-1/+46
| | | | | | | | | | | | | map the rootduid to the DUID of the softraid volume. This means that regardless of where the kernel is loaded from we always get the softraid volume as the root device, providing we booted from one of its chunks. If we boot from any other disk then the rootduid remains unchanged. With this diff it is now possible to have the root filesystem on softraid, however at this stage the kernel still needs to be loaded from a separate FFS partition. ok deraadt@
* When installboot is run on a softraid volume, add boot optional metadatajsing2011-09-191-6/+49
| | | | | | | to store the DUID of the softraid volume and each of the chunks that it is assembled from. This allows us to correctly identify the root disk. ok deraadt@
* Cleanup sr_ioctl_createraid(). There are three clear cases - (1) corruptjsing2011-09-191-40/+27
| | | | | | | | | | or invalid metadata; (2) a new volume with no existing metadata; and (3) an existing volume with metadata. This removes duplicated code and simplifies the code path. Also ensure that we only process the optional metadata once per volume and not once per chunk. Move the optional metadata handler calls into sr_ioctl_createraid().
* Add support for variable length optional metadata in softraid(4). Thisjsing2011-09-181-29/+113
| | | | | | | | | | | will allow new optional metadata types to be added without needing to change the softraid metadata version. Note that this commit changes the softraid metadata version, however an upgrade from older metadata is handled automatically. A full backup prior to upgrading is still strongly recommended. With feedback from stsp@ and marco.
* Rename the optional metadata handler function and factor out the optionaljsing2011-09-181-30/+33
| | | | metadata handling code. This will simplify upcoming changes.
* Fix a formating bug that caused a bad print on big endian arches.marco2011-08-081-2/+2
| | | | ok deraadt
* Backout a bunch of my SCSI commits from c2k11. At least one of thesematthew2011-07-171-3/+3
| | | | | | is causing problems when trying to boot sparc64 from an isp(4). Verified to fix the sparc64/isp(4) regression by krw@; ok deraadt@
* First batch of converting SCSI HBAs from setting saa_targets andmatthew2011-07-081-3/+3
| | | | | | saa_luns instead of adapter_buswidth and luns in the prototype link. ok dlg@, miod@
* Fix the LBA offset calculation for the last block in a rebuild, if therejsing2011-07-071-7/+7
| | | | | | | | | is a partial block. Also correctly handle the case where there is no partial block. Whilst here remove a pointless variable. Issues spotted by and based on diffs from Piotr Durlej - thanks! ok marco@
* Make sr_shutdown() a general function and use this from sr_detach() tojsing2011-07-071-10/+13
| | | | | | | avoid duplication. Implement a sr_shutdownhook() function that simply calls sr_shutdown() and use this for the shutdown hook. ok marco@
* When checking if a chunk is in use, do not match on NODEV.jsing2011-07-061-1/+6
|
* Use a single shutdown hook for the softraid controller instead ofjsing2011-07-061-12/+14
| | | | | | having one per volume. ok marco@
* Actually make sr_detach() work. At this stage we never detach softraid(4),jsing2011-07-061-7/+16
| | | | however since this code exists it still should work correctly.
* Retain a reference to the registered sensor task so that we can unregisterjsing2011-07-061-4/+5
| | | | it again.
* Move all volume shutdown code into sr_shutdown_discipline() and use a flagjsing2011-07-061-13/+16
| | | | | | to indicate if we should force a metadata write. ok marco@
* Fix debugging prints in softraid(4) so that it can compile withmatthew2011-07-041-6/+6
| | | | SR_DEBUG enabled. Broken since r1.227.
* Call config_detach() on the child scsibus in sr_detach().matthew2011-07-031-2/+10
| | | | ok jsing@
* Cleanup the softraid boot probe code. Rename the rather poorly namedjsing2011-07-021-120/+120
| | | | | | | | | | | sr_metadata_list struct to sr_boot_chunk and use a sr_metadata struct rather than an array of u_int8_t when storing the metadata. Also rename some variables to keep the boot volume/boot chunk consistency. This diff also fixes a memory leak where the structures were never freed for key disks. Otherwise there should be no functional change. ok marco@
* Avoid a possible null dereference.jsing2011-06-241-3/+4
| | | | ok marco@
* Simplify softraid(4) to behave like other HBAs by using a singlematthew2011-06-231-78/+90
| | | | | | | | | scsibus(4) for all attached disks, rather than one scsibus(4) per disk. This takes advantage of recent improvements in the SCSI midlayer to better support hotplug devices, and also decouples softraid(4) from scsibus(4) device unit numbers. ok jsing@, dlg@, krw@, deraadt@; marco@'s still unconvinced
* Fix softraid(4) to set xs->cmd = &xs->cmdstore rather than pointing itmatthew2011-06-201-14/+14
| | | | | | to a separately allocated SCSI command structure. ok marco@, jsing@
* Move SLIST initializations earlier so that failure handling paths canmatthew2011-05-031-4/+3
| | | | | | safely use them. Found by Clang. "go for it" marco@
* tiny whitespace fixesdlg2011-04-291-3/+3
|
* only handle vanilla scsi inquiry requests, reject VPD requests since theyredlg2011-04-291-1/+8
| | | | | | | | not handled. based on atascsi code. ok marco@
* Ignore scsi start stop instead of trying to be clever. A softraidmarco2011-04-141-22/+7
| | | | | discipline should always reflect the correct status. This fixes unexpected state changes jordan saw.
* fix installboot.marco2011-04-061-15/+12
| | | | ok jsing
* make rebuild also work in bigmemmarco2011-04-061-3/+4
|
* handle bigmem for metadata reads and writes. this should be pre allocatedmarco2011-04-061-6/+18
| | | | but for now this allows us to move forward.
* Iopoolification. Testing by marco@.krw2011-04-051-64/+42
| | | | ok dlg@ marco@
* Attach one sensordev per softraid device rather than one sensordev perjsing2011-03-151-8/+17
| | | | | | | | | | discipline. This results in a drive sensor being attached for each volume under the same sensordev, instead of having multiple sensordevs each with a single drive. Fixes PR6576. Tested by Mattieu Baptiste. ok deraadt@
* spaces that make my eyes bleed. no binary change.marco2011-01-291-13/+10
|
* Factor out block level I/O handling code and correctly handle I/Os thatjsing2011-01-231-92/+80
| | | | | | | | exceed MAXPHYS in size. Thanks to ckuethe@ and stsp@ for testing. ok marco@
* Ensure that boot storage area exists and is large enough, beforejsing2011-01-221-1/+7
| | | | | | installing boot code. ok marco@
* more explicit_bzero to delete keys.marco2011-01-121-1/+2
| | | | prodded and ok deraadt
* READ CAPACITY and READ CAPACITY 16 commands report the last validkrw2010-12-201-4/+6
| | | | | | | | | | | logical block address, not the size of the device. Adjust softraid's handling of the commands accordingly. Fixes panics when newfs'ing the 'c' partition of a softraid volume (one shouldn't newfs 'c' partitions of any device). Reported by Andreas Bartlet via tech@. Fix tested by Andreas. ok marco@. functionally identical diff developed by dlg@
* Move raid1 and crypto io to a workq. This is to avoid a potential VOP_marco2010-11-061-5/+37
| | | | | | | | | call while in interrupt context. Contains an additional spl dance as found by thib. Tested by many opn various arches. Note that raid 0/4/5/6 have not been moved over yet.
* Force openings to 1 for devices that can't do tagged i/o, i.e. morekrw2010-10-121-1/+2
| | | | | | | | | | | | | | than 1 i/o active at once. This reduces the chances that concurrent i/o's for such devices will confuse the device or the adapter code. It also eliminates a reason for adapter code to maintain its own queues. Tweak all drivers that fake INQUIRY results to set the SID_CmdQue flag, thus continuing to claim to be able to do tagged i/o. Positive feedback from matthew@ and marco@ for an earlier version. ok dlg@
* The only sensible argument for VOP_* calls that take a struct proc pointer isoga2010-09-231-20/+25
| | | | | | | | | | | | | | | | | | curproc. A bunch of callers were passing in 0 (not even NULL, 0) as this pointer, which was fine until the called vnode function tried to do something with it. Typically, this code was then copy/pasted to various parts of the tree. Accept the facts of life and switch all of these over to passing curproc for now until the argument can be removed. Discovered by stsp trying to create a softraid on top of a vnd, which crashed with a NULL deref in vndioctl. softraid bits tested by mikeb and jsing. raidframe bits tested by pea, matthieu and naddy. The rest tested by at least thib, jsing and myself. ok thib@, jsing@.
* having a ca_activate function which just returns 1 is wrong on about 8 different levels; ok oga kettenisderaadt2010-09-071-9/+1
|
* fix tailq use; ok thibderaadt2010-08-301-2/+2
|
* During boot probe walk disklist rather than alldevs. This avoids a racejsing2010-08-301-27/+53
| | | | | | | | | where disks can be on alldevs, however they are not yet initialised and have not yet called disk_attach() (in particular this means that dk_label is a null pointer). Also, if we sleep restart the scan from the top of the disklist in case things have changed whilst we slept. ok marco@
* explicitly specify flags to malloc and pool_get instead of relying on 0.tedu2010-07-031-7/+8
| | | | | This is more clear, and as thib pointed out, the default in softraid was wrong. ok thib.
* Rename the volume specific flags variable.jsing2010-07-021-10/+10
| | | | ok marco@
* Determine the data offset using a variable specified within the softraidjsing2010-07-021-9/+36
| | | | | | | | | | metadata. This allows us to implement seamless transitions from the previous metadata version to the current version, avoiding the need to recreate the softraid volume. Joint work with marco@ during c2k10. ok marco@
* Remove all adapter-specific 'struct scsi_device's. They are never used. Firstkrw2010-06-281-6/+1
| | | | | | | | step in elminating 'struct scsi_device' entirely. Spotted and initial diff from matthew@. ok matthew@ dlg@ deraadt@ marco@ miod@
* softraid doesnt provide disk cache settings to tweak, mark those ioctls asdlg2010-06-151-2/+8
| | | | | | | | | | not supported. this prevents a panic caused by recursively entering the ioctl handler that now happens on boot when sd tries to enable write cache on all disks. found by ckeuthe@ tested by todd@
* dont pass the dev_t from the scsi device drivers into the midlayer fordlg2010-06-151-4/+3
| | | | | | | ioctl requests, and dont pass the proc pointers around for any ioctl requests in scsi land at all. neither were used, so trim the fat. ok krw@ marco@
* Make compile with NBIO = 0marco2010-05-211-1/+3
|
* New scsi code seems to be stable. Pluck previously identifiedkrw2010-05-201-5/+1
| | | | | | | low-hanging splbio/splx pairs that are no longer needed and see if this reveals any hidden scsi flaws. ok dlg@