summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
AgeCommit message (Collapse)Author
2022-04-16Fix mistake in error branch locking caused by previous changes.andvar
vput(vp) also unlocks vp, thus unlocking happens twice in error flow causing kernel to panic with failed assertion lktype != LK_NONE in vfs_vnode.c#778. Thanks riastradh with finding the issue.
2022-04-16Unlock vnode for VOP_IOCTL().hannken
2022-04-08s/postion/position/andvar
2022-03-28Restore another historic RCS Id.wiz
2022-03-28driver(9): devsw_detach never fails. Make it return void.riastradh
Prune a whole lotta dead branches as a result of this. (Some logic calling this is also wrong for other reasons; devsw_detach is final -- you should never have any reason to decide to roll it back. To be cleaned up in subsequent commits...) XXX kernel ABI change to devsw_detach signature requires bump
2022-03-20s/initialiase/initialise/ in comments.andvar
2022-03-11convert non-config-handled "DEBUG_ROOT" to aprint_debug().mrg
now it's possible to get boot-time info about raidframe root device selection with simple "boot -x".
2022-03-09merge two debug lines in auto-root selection.mrg
2022-02-16fix various typos, mainly in comments.andvar
2022-01-24s/begining/beginning/ in comments and messages.andvar
2021-12-14call buf_destroy() after buf_init(). hopefully fixes the lockdebugmrg
problem shown here: http://mail-index.netbsd.org/tech-kern/2021/12/10/msg027851.html but seems unlikely to fix the original problem. tested on i386/anita. ok oster@ XXX: pullup-9 (netbsd-8 uses old APIs.)
2021-12-11remove clause 3 from all my licenses that aren't conflicting withmrg
another copyright claim line. again. (i did this in 2008 and then did not update all of my personal templates.)
2021-12-10s/occured/occurred/ in comments, log messages and man pages.andvar
2021-12-05s/convience/convenience/ in comment.msaitoh
2021-09-09sys/dev: Memset zero before copyout.riastradh
Just in case of uninitialized padding which would lead to kernel stack disclosure. If the compiler can prove the memset redundant then it can optimize it away; otherwise better safe than sorry. I think the iwi(4), mcd(4), and ses(4) changes actually plug leaks; the raidframe(4) change probably doesn't (but doesn't hurt).
2021-08-28If there is a FS_RAID partition on a disk, then we shouldn't look atoster
the raw partition. In particular, we now need to account for the case where an existing FS_RAID partition is now open because it is in use. If that is the case, we don't look at the raw partition. Addresses PR kern/56369.
2021-08-08s/arry/array/andvar
2021-08-07Merge thorpej-cfargs2.thorpej
2021-08-02Accidentally commited some other changes that weren't quite ready. Addoster
these changes to fix the build.
2021-08-02Support on-demand re-scanning all devices to look foroster
autoconfig RAID sets. raidctl now supports looking for autoconfig RAID sets with a new '-L' flag.
2021-08-02fix various typos in comments and log messages.andvar
2021-08-01s/overwriten/overwritten/ in comments.andvar
2021-08-01fix typos in word "otherwise".andvar
2021-07-27Missed cleaning up this "peek" routines the other day. Take care of it now.oster
2021-07-27rf_CreateDiskQueueData() no longer uses waitflag, and will always succeed.oster
Cleanup the error path for the (no longer needed) PR_NOWAIT cases.
2021-07-26Add support for detecting and configuring nested RAID setups at boot.oster
2021-07-23The number of components used must be at least 2. An odd number of componentsoster
is not allowed. PR bin/45162
2021-07-23Various disk queue "peek" routines were only ever used in the simulatoroster
version of RAIDFrame. Remove them from here.
2021-07-23All IO is async in the RAIDframe kernel driver, so desc->async_flagoster
isn't needed. Cleanup the flag from rf_DoAccess() and its caller as well.
2021-07-23The 'pss_issued' pool is unused, so remove it.oster
2021-07-23Extensive mechanical changes to the pools used in RAIDframe.oster
Alloclist remains not per-RAID, so initialize that pool separately/differently than the rest. The remainder of pools in RF_Pools_s are now per-RAID pools. Mostly mechanical changes to functions to allocate/destroy per-RAID pools. Needed to make raidPtr available in certain cases to be able to find the per-RAID pools. Extend rf_pool_init() to now populate a per-RAID wchan value that is unique to each pool for a given RAID device. TODO: Complete the analysis of the minimum number of items that are required for each pool to allow IO to progress (i.e. so that a request for pool resources can always be satisfied), and dynamically scale minimum pool sizes based on RAID configuration.
2021-07-23getiobuf() can return NULL if there are no IO buffers available.oster
RAIDframe can't deal with that, so create a dedicated pool of buffers to use for IO. PR_WAITOK is fine here, as we pre-allocate more than we need to guarantee IO can make progress. Tuning of pool still to come.
2021-07-21Remove commented line that is a duplicate of a real line.oster
2021-05-26support different endian raidframe component label.mrg
there are two on-disk formats in use in raidframe: - the component label - the parity map the parity map is a bitmap implemented as bytes, so it has no endian issue. the component label is the problem, as most of the fields are 32 bit. this change only supports version 2 of raidframe (active since the year 2000.) as component labels are read and used before a raidPtr for the raid set has been created, there is no obvious storage for the swapped indicator, so the in-core version remains the on-disk version, while the rest of in-core label is swapped. in raidread_component_label() and raidwrite_component_label(), check if the swapped version, and if so, call new rf_swap_label() and ensure that the in-core label is native-byte order. for the write method, an on-stack copy is modified before writing, so that the in-core version remains valid. (this stack usage is below other stack usage in similar functions here.) adjust the label ioctls RAIDFRAME_GET_COMPONENT_LABEL and RAIDFRAME_GET_COMPONENT_LABEL80 to return the byte-swapped version so that eg, raidctl -s reports the right version. when performing final configuration of a raidset, report if a label swapped, and also complain if there are differently swapped versions on the other components. tested on arm64, sparc64 and amd64 ok @oster
2021-05-24make various things static, and minor KNF clean up.mrg
ignore spiflash as a raid device.
2021-04-26if raidframe sets booted_device, log a debug message about it.mrg
2021-04-11mark an extremely uncommon, but sometimes seen, log messagemrg
with the function name it comes with.
2021-02-15Fix a long long-standing off-by-one error in computing lastPSID.oster
SUsPerPU is only really supported for a value of 1, and since the first PSID is 0, the last will be numStripe-1. Also update the setting of pending_writes to reflect the change to lastPSID. Needs pullups to -8 and -9.
2020-09-27DIOCCACHESYNC takes an int argument, pass it through.christos
2020-08-25KNFskrll
2020-07-31no need for continuechristos
2020-07-31- don't overwrite existing error.christos
- return the error not 0 if failing.
2020-07-31Factor out the component cache flushing code; add retries.christos
2020-06-20Nix trailing whitespace.riastradh
2020-06-19remove unnnecessary splbio() in rf_FreeDiskQueueData()jdolecek
2020-06-19pass down b_flags B_PHYS|B_RAW|B_MEDIA_FLAGS from bio subsystemjdolecek
to component I/O fixes the xbd(4) KASSERT() triggered by raidframe, noted in PR kern/55397 by Frank Kardel
2020-06-16Improve wording in comments in raid_dumpblock().oster
2020-04-13slightly change and fix the semantics of pool_set*wat(), pool_sethardlimit()chs
and pool_prime() (and their pool_cache_* counterparts): - the pool_set*wat() APIs are supposed to specify thresholds for the count of free items in the pool before pool pages are automatically allocated or freed during pool_get() / pool_put(), whereas pool_sethardlimit() and pool_prime() are supposed to specify minimum and maximum numbers of total items in the pool (both free and allocated). these were somewhat conflated in the existing code, so separate them as they were intended. - change pool_prime() to take an absolute number of items to preallocate rather than an increment over whatever was done before, and wait for any memory allocations to succeed. since pool_prime() can no longer fail after this, change its return value to void and adjust all callers. - pool_setlowat() is documented as not immediately attempting to allocate any memory, but it was changed some time ago to immediately try to allocate up to the lowat level, so just fix the manpage to describe the current behaviour. - add a pool_cache_prime() to complete the API set.
2020-03-21Restore historic $Hdr: ...$ text.riastradh
This was presumably eaten by git cvsexportcommit, which is curious because I thought I had gotten out of the habit of passing -k to it.
2020-03-01Add a flag to dk_dump for virtual disk devices.riastradh
If a disk is backed by a physical medium other than itself, such as cgd(4), then it passes DK_DUMP_RECURSIVE to disable the recursion detection for dk_dump. If, however, a device represents a physical medium on its own, such as wd(4), then it passes 0 instead. With this, I can now dump to dk on cgd on dk on wd.