summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Provide clear errors when trying to install oversized boot loaderkn2020-06-081-3/+9
| | | | | | | | | | | | | | | | sparc64 installboot(8) on softraid(4) with too large files, e.g. unstripped builds, fails poorly with "installboot: softraid installboot failed". This is due to the BIOCINSTALLBOOT ioctl(2) returing the default EINVAL rather than using softraid's sr_error() interface properly; additionally, installboot does not check for such message from the bio(4) layer. Make the kernel generate "boot block too large" and "boot loader too large" messages for softraid devices and have installboot act upon them analogous to bioctl(8), by adapting its bio_status() into the new sr_status() helper. Input, reminder to look at bioctl, same kernel diff from, OK jsing
* Prevent uninitialized use of bbs and bls in the error pathjca2020-04-141-2/+2
| | | | | Harmless since free(9) first checks that the pointer is not NULL. ok krw@
* Remove redundant VOP_CLOSE() and vput(). The fail branch will closevisa2020-04-061-3/+1
| | | | | | the vnode because `open' is true. OK deraadt@, anton@
* Remove unused argument to sr_error.tobhe2020-03-101-2/+2
| | | | ok kn@ deraadt@
* Nuke *_minphys() functions that either simply apply MAXPHYS or dokrw2020-02-131-13/+2
| | | | | | | | nothing at all. MAXPHYS will be applied in minphys() and nothing at all, well, doesn't do anything. Also remove any '#define <blah> MAXPHYS' statements used solely to disguise MAXPHYS in said functions.
* Drivers that implement their own *minphys() don't need to call thekrw2020-01-251-2/+1
| | | | | | | system minphys(). scsi_minphys() will do that and cd/sd/st will call scsi_minphys(). ok jmatthew@ as part of larger diff
* softraid(4): tsleep(9) -> tsleep_nsec(9); ok kn@cheloha2019-08-081-10/+13
|
* Fix a free size panic when detaching a crypto softraid on i386.bluhm2019-07-041-5/+6
| | | | | | Store the size of struct sr_workunit depending on the softraid type in struct sr_discipline. testing and OK jan@
* Correct free size. Fixes a panic when detaching crypto volumes.tim2019-05-181-2/+3
| | | | OK jan@, "yes please" tedu@
* Fix free(9) sizes in softraid(4)jan2019-05-151-26/+28
| | | | OK tedu@
* Remove proc from the parameters of vn_lock(). The parameter isvisa2018-05-021-3/+2
| | | | | | unnecessary because curproc always does the locking. OK mpi@
* sr_quiesce() is a new approach for ensuring that softraid drainsderaadt2018-02-081-1/+19
| | | | | | | | output to the disks. This is part of a larger suspend/resume filesystem-safety diff, which has been worked on for a couple of months already. Tests by job, krw, beck, benno, and others. Sometimes even by snapshot users...
* Use duid_format() instead of rolling one locally.krw2018-02-071-13/+5
| | | | ok jsing@ tb@
* Two width specifiers changed from %02 to %0 in previous. Change them back.tb2017-12-211-2/+2
| | | | ok deraadt
* Do not use %hx for chars, ok kettenisderaadt2017-12-211-3/+3
|
* Add a sanity check on the number of chunks beingkrw2017-12-201-1/+8
| | | | | assembled into a volume, to enure the on-disk metadata and the in-memory metadata agree.
* Don't bother using DETACH_FORCE for the softraid luns at rebootderaadt2017-12-141-10/+11
| | | | | time; the aggressive mountpoint destruction seems to hit insane use-after-frees when we are already far on the way down.
* In the case that we want to force a new RAID assembly and the metadatapatrick2017-09-061-2/+2
| | | | | | | | | type on the chunks is not the same, we don't actually care because we are going to clear their metadata anyway, so don't error out. This allows assembling a new RAID based on a drive that is zeroed and one that used to be part of a softraid in its previous life. ok jsing@
* Report the rebuild state properly, so that in the case of a rebuildpatrick2017-08-301-1/+6
| | | | | | the sensor does not show the drive state as "unknown". ok phessler@
* tweak malloc(9) flags: since that M_NOWAIT might return NULL hence itgsoares2017-07-241-6/+6
| | | | | | doesnt make sense to use M_CANFAIL flag. ok dlg jsing
* Upon failure, only return zero from the softraid ioctl handler when therejsing2017-06-121-2/+5
| | | | | | | is at least one bio status message. It is a much nicer user experience when we properly report failures, however in the case that we fail to do this, getting an errno back from the ioctl is somewhat better than simply printing "unknown error" from bioctl(8).
* Provide sufficient info in error messages to identifykrw2017-06-061-5/+5
| | | | | | | | | | softraid volume and backing disk when i/o errors occur. Original issue reported by Paul de Weerd. Suggestions from jsing@. ok deraadt@ mikeb@
* Avoid some false positives with cppcheck. No binary change.bluhm2017-04-141-2/+3
| | | | OK jsg@
* If the sub-device of a softraid lacks a side-effect io function, returnderaadt2017-03-271-1/+3
| | | | | failure as early as possible. ok mlarkin claudio
* Restore behavior from before r1.376: only set bv_percent if a rebuild istb2017-03-191-2/+3
| | | | | | | in progress. This eliminates the spurious and harmless "0% done" message in the output of 'bioctl softraid0' reported by various on misc. ok jsing
* Plug potential leak of device list.krw2016-07-201-2/+6
| | | | | | Problem found by Michael McConville. Tested & ok stsp@
* Provide a function for calculting the rebuild percentage, rather thanjsing2016-05-311-25/+19
| | | | | | having five copies of the same code. ok krw@
* Panic when attempting to execute a scsi command with no disciplinekrw2016-04-291-6/+4
| | | | | | | | | defined. Carrying on is pointless. And will currently cause a NULL pointer deref anyway. NULL deref found by mmcc@ and his friend clang. ok deraadt@
* Display correct value in error message.krw2016-04-261-2/+2
|
* Do NOT attempt a rebuild using a hot spare with a sector sizekrw2016-04-261-2/+8
| | | | | | | | greater than the sector size of the softraid volume. i.e. 512-byte hot spares should work on 4096-byte volumes but 4096-byte hotspares will not work on 512-byte volumes. Pointed out, errors corrected and ok jsing@
* Restore intro comment to sr_hotspare_rebuild(), which was erroneouslykrw2016-04-261-1/+5
| | | | | | replaced by comment for first chunk of code. Pointed out by jsing@.
* Use consistent intro comment when searching for the first offlinekrw2016-04-191-5/+2
| | | | | chunk and perhaps save the next person reading the code some confusion.
* Use variable 'cid' in for(;;) rather than 'i' with an assignmentkrw2016-04-191-6/+4
| | | | | 'cid = i;' when break'ing. Makes code consistent with same search later. No functional change and shrinks later functional diff.
* Change a variable name (chunk_no -> cid) to make a couple of codekrw2016-04-191-5/+5
| | | | | chunks more obviously the same. Reduces size of upcoming diff. No functional change.
* No need to rescan chunks in each discipline to find appropriatekrw2016-04-121-2/+7
| | | | | | volume sector size. Determine volume sector size in sr_meta_init(). Pointed out, tweaked and ok jsing@
* Enable creation of softraid volumes using disks with non-512 bytekrw2016-04-041-33/+27
| | | | | | | | | sectors. Volumes created will present a sector size equal to the largest sector size of the constituent disks. Softraid Metadata version cranks to 6 due to new field. ok jsing@ with tweaks that will follow soon.
* Avoid using uninitialized variables in two corner cases. In onekrw2016-02-141-4/+7
| | | | | | | | case check if it was set and bail out with a useful message if not. In the other the variable was the wrong one anyway, and we can just use the correct variable. Found by & ok jsg@
* Remove NULL-checks before free().mmcc2015-12-291-28/+15
| | | | ok tb@
* Stop passing around constants for metadata size and location. Justkrw2015-08-191-12/+9
| | | | | | use the constants where needed. ok jsing@
* Zap a SLIST in a more obviously correct/safe way.krw2015-07-291-3/+2
| | | | | | Originally from pelikan@, recent prodding from bluhm@ and jsg@. ok pelikan@ millert@ bluhm@
* Tweak a couple of [SLIST|TAILQ]_REMOVE() usages in loops to a morekrw2015-07-281-15/+15
| | | | | | obvious idiom. ok bluhm@ jsing@
* zap trailing linefeeds from sr_error() and panic() callshalex2015-07-271-5/+5
| | | | ok jsing@
* A few more daddr_t fixes. Rename 'phys_off' variables to 'offset'krw2015-07-211-38/+38
| | | | | | | | | since they are now relative to chunks. Use 'blkno' as normal variable name for daddr_t items rather than mix of 'blkno, blk, offset. Change field name ssd_data_offset to ssd_data_blkno since it is a block and not byte quantity. No intentional functional change.
* fix spacingmlarkin2015-07-201-2/+2
|
* Stop passing daddr_t parameters for lengths. Use long since that's the typekrw2015-07-191-3/+3
| | | | | | of the destination fields. ok jsing@
* Change some obviously incorrect usages of daddr_t (a DEV_BSIZEkrw2015-07-191-13/+41
| | | | | | | | | | address) to 64 signed or unsigned ints. Add some paranoia checks during partition size calculations to account for the fact that partition sizes (DL_GETPSIZE()) are unsigned values. More daddr_t rectification to do. ok jsing@
* Stop adding and subtracting data offset. Just keep to chunk relativekrw2015-07-191-2/+2
| | | | | | | | | block offsets until actual i/o is constructed and needs the physical offset. Eliminate a number of <<DEV_BSIZE shifts as a bonus. No intentional functional change. Fixed and ok jsing@
* Use DEV_BSIZE instead of 512 where appropriate. Use DL_SECTOBLK()krw2015-07-191-28/+30
| | | | | | | | where appropriate. Noop for disks with 512-byte sectors. i.e. the only kind currently allowed in softraid volumes. But starts laying the groundwork to allow disks with other sector sizes. ok jsing@
* Nuke annoying whitespace nits to shrink some future diffs.krw2015-05-291-6/+5
|
* Signed types are bad array indicies - let it panic instead.pelikan2015-05-201-2/+3
| | | | ok deraadt krw millert