summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 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@
* dont let sys/ioctl.h imply that you get the ioctls in dkio.h. thisdlg2010-05-181-1/+2
| | | | | | | | | | | gets rid of #include <sys/dkio.h> in sys/ioctl.h and adds #include <sys/dkio.h> to the places that actually want and use the disk ioctls. this became an issue when krw@'s X build failed when he was testing a change to dkio.h. tested by krw@ help from and ok miod@
* Completely overhaul optional metadata handling, allowing for multiplejsing2010-03-281-46/+51
| | | | | | | optional metadata per volume and discipline specific optional metadata processing. ok marco@
* Avoid potential null dereferences in ioctl paths.jsing2010-03-281-2/+8
| | | | | | Found by jsg@ using the clang static analyser. ok marco@
* Replace a scsi_done() call with sr_scsi_done() which fixes a missingjsing2010-03-281-3/+2
| | | | | | | | splx() call. Found by jsg@ using the clang static analyser. ok marco@
* Correctly initialise variable to prevent free without malloc in error path.jsing2010-03-271-2/+2
| | | | Found by clang static analyser.
* Add an ioctl to softraid to allow the boot block and boot loader to bejsing2010-03-261-1/+156
| | | | | | | installed on a softraid volume. This is work in progress but can continue in tree. ok marco@
* Add storage for the boot block and boot loader to the softraid metadata.jsing2010-03-261-7/+4
| | | | | | | | | | | | | Also add a new optional metadata type for boot data. This is the first step (of many) towards being able to boot from softraid volumes. WARNING: This version of the softraid metadata is not compatible with previous versions. As a result, any softraid volumes created with older kernels will not assemble. Data on existing softraid volumes should be backed up before upgrading. The volume should then be recreated and the data restored. ok marco@
* Change the scsi_cmd function member of scsi_adapter from int tokrw2010-03-231-6/+8
| | | | | | | | | | | | | void. Use XS_NO_CCB error in the scsi command (xs) to report the NO_CCB condition. Eliminates all SUCCESSFULLY_QUEUED and COMPLETE confusion and untangles the midlayer from the adapter a bit more. Eyes and some fixes by miod@ There may be some compile issues on little used (i.e. I don't have any) drivers but the change is mechanical and thus easy to remedy. ok dlg@