summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
AgeCommit message (Collapse)Author
2023-06-15Undo unlock/relock for VOP_IOCTL().hannken
PR kern/57450 (unplugging hung USB disk triggers panic via _vstate_assert)
2023-05-27fix word endings toin -> tion in comments.andvar
2023-03-30raidframe: Nix unused parameter to raidwrite_component_area.riastradh
All calls use the same value. Prune dead branches using it.
2022-08-28Simplify the check for what ioctls can be done in raidioctl() withoutoster
the device being initialized.
2022-08-28RAIDframe must be initialized for the RAIDFRAME_SET_LAST_UNIToster
and RAIDFRAME_SHUTDOWN ioctls. XXX Pullup-9 Reported-by: syzbot+1c20fcbe34d72cd7fbda@syzkaller.appspotmail.com
2022-08-10raidframe: reject invalid values for numCol and numSparesmrg
numCol and numSpares are "int" so they can be "-1" internally, which means negative values need to be rejected, as well as values higher than RF_MAXCOL/RF_MAXSPARES. explicitly nul-terminate all strings coming from userland. some minor CSE that avoids signed arith. this fixes issues in the RAIDFRAME_ADD_HOT_SPARE, RAIDFRAME_CONFIGURE, RAIDFRAME_DELETE_COMPONENT, RAIDFRAME_INCORPORATE_HOT_SPARE, and RAIDFRAME_REBUILD_IN_PLACE ioctl commands. Reported-by: syzbot+b584943ad1f8ab9d4fe0@syzkaller.appspotmail.com https://syzkaller.appspot.com/bug?id=61e07e418261f8eec8a37a9226725fe31820edd0 https://syzkaller.appspot.com/bug?id=ca0c997b40de81c0f0b44790217731f142003149 https://syzkaller.appspot.com/bug?id=6fc452d228453494655a85264591dd9054cc0b08 https://syzkaller.appspot.com/bug?id=873f0271682713a27adc9a49dd7109c70b35fda3 XXX: pullup-8, pullup-9. ok oster@ riastradh@
2022-06-28RAIDframe must be initialized for the RAIDFRAME_FAIL_DISK80 ioctl.oster
Reported-by: syzbot+048387fcc9a1a3682638@syzkaller.appspotmail.com Reported-by: syzbot+037d1813186571cb2d38@syzkaller.appspotmail.com
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