summaryrefslogtreecommitdiff
path: root/sys/dev/softraid.c
AgeCommit message (Collapse)Author
2011-04-06handle bigmem for metadata reads and writes. this should be pre allocatedMarco Peereboom
but for now this allows us to move forward.
2011-04-05Iopoolification. Testing by marco@.Kenneth R Westerback
ok dlg@ marco@
2011-03-15Attach one sensordev per softraid device rather than one sensordev perJoel Sing
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@
2011-01-29spaces that make my eyes bleed. no binary change.Marco Peereboom
2011-01-23Factor out block level I/O handling code and correctly handle I/Os thatJoel Sing
exceed MAXPHYS in size. Thanks to ckuethe@ and stsp@ for testing. ok marco@
2011-01-22Ensure that boot storage area exists and is large enough, beforeJoel Sing
installing boot code. ok marco@
2011-01-12more explicit_bzero to delete keys.Marco Peereboom
prodded and ok deraadt
2010-12-20READ CAPACITY and READ CAPACITY 16 commands report the last validKenneth R Westerback
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@
2010-11-06Move raid1 and crypto io to a workq. This is to avoid a potential VOP_Marco Peereboom
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.
2010-10-12Force openings to 1 for devices that can't do tagged i/o, i.e. moreKenneth R Westerback
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@
2010-09-23The only sensible argument for VOP_* calls that take a struct proc pointer isOwain Ainsworth
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@.
2010-09-07having a ca_activate function which just returns 1 is wrong on about 8 ↵Theo de Raadt
different levels; ok oga kettenis
2010-08-30fix tailq use; ok thibTheo de Raadt
2010-08-30During boot probe walk disklist rather than alldevs. This avoids a raceJoel Sing
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@
2010-07-03explicitly specify flags to malloc and pool_get instead of relying on 0.Ted Unangst
This is more clear, and as thib pointed out, the default in softraid was wrong. ok thib.
2010-07-02Rename the volume specific flags variable.Joel Sing
ok marco@
2010-07-02Determine the data offset using a variable specified within the softraidJoel Sing
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@
2010-06-28Remove all adapter-specific 'struct scsi_device's. They are never used. FirstKenneth R Westerback
step in elminating 'struct scsi_device' entirely. Spotted and initial diff from matthew@. ok matthew@ dlg@ deraadt@ marco@ miod@
2010-06-15softraid doesnt provide disk cache settings to tweak, mark those ioctls asDavid Gwynne
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@
2010-06-15dont pass the dev_t from the scsi device drivers into the midlayer forDavid Gwynne
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@
2010-05-21Make compile with NBIO = 0Marco Peereboom
2010-05-20New scsi code seems to be stable. Pluck previously identifiedKenneth R Westerback
low-hanging splbio/splx pairs that are no longer needed and see if this reveals any hidden scsi flaws. ok dlg@
2010-05-18dont let sys/ioctl.h imply that you get the ioctls in dkio.h. thisDavid Gwynne
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@
2010-03-28Completely overhaul optional metadata handling, allowing for multipleJoel Sing
optional metadata per volume and discipline specific optional metadata processing. ok marco@
2010-03-28Avoid potential null dereferences in ioctl paths.Joel Sing
Found by jsg@ using the clang static analyser. ok marco@
2010-03-28Replace a scsi_done() call with sr_scsi_done() which fixes a missingJoel Sing
splx() call. Found by jsg@ using the clang static analyser. ok marco@
2010-03-27Correctly initialise variable to prevent free without malloc in error path.Joel Sing
Found by clang static analyser.
2010-03-26Add an ioctl to softraid to allow the boot block and boot loader to beJoel Sing
installed on a softraid volume. This is work in progress but can continue in tree. ok marco@
2010-03-26Add storage for the boot block and boot loader to the softraid metadata.Joel Sing
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@
2010-03-23Change the scsi_cmd function member of scsi_adapter from int toKenneth R Westerback
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@
2010-02-13Force chunks into correct order once metadata is attached. This preventsJoel Sing
chunks from being reordered on an existing volume. ok marco@
2010-02-13Unbreak automatic rebuilds from hotspares.Joel Sing
ok marco@
2010-02-13Removed unused variable sml_vn.Joel Sing
ok @marco
2010-02-13Pass the number of chunks to sr_meta_attach() rather than recalculating.Joel Sing
ok marco@
2010-02-08Use character raw device to read disklabel during bootprobe, as allKenneth R Westerback
other devices do. Silences complaints about missing media on removable media devices. ok marco@ jsing@
2010-01-09Zap all setting of ITSDONE in drivers that don't look at it. NobodyKenneth R Westerback
else cares so it's just noise. Drivers that actually look at ITSDONE are unchanged. ok marco@ (for his files) dlg@ beck@
2009-12-31Add support for key disks. This allows a crypto volume to be constructedJoel Sing
without using a passphrase - instead the encryption mask key is stored on the specified key disk partition (ideally being one on a removable device). This also enables automatic assembly of crypto volumes at boot time. ok marco@
2009-12-15Allow auto assemble flag to be toggled for disciplines that support it.Joel Sing
"Love it!" marco@
2009-12-15Factor out discipline specific create/assemble code.Joel Sing
"in, in, in!" marco@
2009-12-15Explicitly lock the vnode when deleting a volume. This avoids a potentialJoel Sing
panic that is caused by vnode aliasing, where checkalias() switches the vnode ops for our vnode. This means that we end up using ufs unlocking rather than specfs unlocking (which is a no-op). ok marco@
2009-12-07Cleanup discipline initialisation.Joel Sing
ok marco@
2009-12-07Define discipline capabilities using a set of flags.Joel Sing
"shiny!!" marco@
2009-11-24Allow the passphrase to be changed on softraid crypto volumes. Ensure thatJoel Sing
you backup your data and lock up your pets prior to using this. Tested by todd@ ok marco@
2009-11-23Improve discipline specific ioctl framework and attach to softraid ioctl.Joel Sing
ok marco@
2009-11-22Add a framework for discipline specific ioctls.Joel Sing
ok marco@
2009-11-22Ensure that chunks are not already in use when creating a volume.Joel Sing
ok marco@
2009-11-15Fix memory leak in error case. Found by Parfait.Joel Sing
ok marco@ deraadt@
2009-10-29When probing devices at boot, compare against the full device driver nameJoel Sing
rather than the start of the device name. Also, be inclusive with devices probed rather than exclusive - this means we now only look for RAID partitions on sd(4) and wd(4) devices. prodded by deraadt@ ok marco@ deraadt@
2009-10-28Remove FWRITE from closes that aren't opened with FWRITE.Marco Peereboom
spotted and ok jsing
2009-10-13Get rid of devact enum, substitute it with an int and coresponding defines.Paul Irofti
This is needed for the addition of further suspend/resume actions. Okay deraadt@, marco@.