Home | History | Annotate | Download | only in bioctl
History log of /src/sbin/bioctl/bioctl.c
RevisionDateAuthorComments
 1.20  04-Aug-2023  rin bioctl(8): bio_show_volumes(): Do not return pointer to stack.

Found by GCC 12.
 1.19  10-May-2022  msaitoh bioctl(8): Don't print garbage bv_seconds.

This bug was added in bioctl.c rev. 1.7.

Before:
Volume Status Size Device/Label Level Stripe
 1.18  04-Feb-2019  mrg branches: 1.18.2;
- bump buffer sizes to avoid potential truncation issues
 1.17  16-Jan-2015  christos branches: 1.17.8; 1.17.16;
kill 1 copy of strtonum.
 1.16  15-Nov-2014  joerg Skip vendor if the string is empty.
 1.15  29-Aug-2011  joerg branches: 1.15.20;
Use __dead
 1.14  25-May-2011  joerg Simplify
 1.13  20-Feb-2010  ahoka Fix two problems with argc handling in bioctl(8), which makes
bioctl(8) dump core if expected arguments are not passed in.

Closes PR bin/39946 (patch by Juan RP).
 1.12  18-Jan-2009  lukem fix -Wsign-compare issues
 1.11  03-Mar-2008  xtraeme Improve usage() and manpage commands/args.
 1.10  03-Mar-2008  xtraeme - Fix total user specified and free disk size based on the RAID level.
- Adapt for BIOC_SVOL_RAID01 and BIOC_SVOL_RAID10 levels.
 1.9  01-Mar-2008  xtraeme On RAID 1 volumes and when bv_stripe_size is 0 make it print 'N/A', like:

$ sudo bioctl arcmsr0 show volumes
Volume Status Size Device/Label Level Stripe
 1.8  29-Feb-2008  xtraeme bio_setstate_consistency: zero out the struct before anything else,
and fix argv argument for strtoul().
 1.7  02-Jan-2008  xtraeme branches: 1.7.2; 1.7.4;
Rewrite bioctl(8) and add support for the following features:

- Ability to add/remove hot-spare disks (previously only 'add' was accepted).
- Ability to add/remove pass-through disks.
- Ability to create/remove RAID volumes with optional size, stripe, level,
member disks and others.
- Ability to start/stop consistency checks in a RAID volume.
- Ability to show only information about physical disks, volumes or both.

Rather than using multiple flags, the utility has been modified to use
the same mode than dkctl(8) (and maybe others), i.e:

$ ./bioctl
usage: bioctl device command [arg [...]]
Available commands:
show [disks] | [volumes]
alarm [enable] | [disable] | [silence] | [test]
blink start | stop [channel:target[.lun]]
hotspare add | remove channel:target.lun
passthru add DISKID | remove channel:target.lun
check start | stop VOLID
create volume VOLID DISKIDs [SIZE] STRIPE RAID_LEVEL channel:target.lun
remove volume VOLID channel:target.lun
$

I'll add support for other features soon.
 1.6  07-Dec-2007  xtraeme branches: 1.6.2;
Add BIOC_SVMIGRATING to bio(4) and bioctl(8) to report if a volume
is migrating currently showing the percentage.

Update arcmsr(4) to report this, like:

$ sudo ./bioctl -h arcmsr0
Volume Status Size Device
arcmsr0 0 Migrating 698G ARC-1210-VOL#00 RAID 5 7% done
0 Online 234G 0:0.0 noencl <WDC WD2500YS-01SHB1 20.06C06>
1 Online 234G 0:1.0 noencl <WDC WD2500YS-01SHB1 20.06C06>
2 Online 234G 0:2.0 noencl <WDC WD2500YS-01SHB1 20.06C06>
3 Online 234G 0:3.0 noencl <WDC WD2500YS-01SHB1 20.06C06>
$
 1.5  05-Dec-2007  xtraeme There's no need to waste 14 spaces in the third element when the
the human output is requested, align it at most 4 spaces.

I'd also make the human output the default but not sure everybody will
agree...
 1.4  05-Dec-2007  xtraeme - Remove -D flag... it's useless (it was removed in OpenBSD as well).
- Use errx(3) in the appropiate function rather than warn(4) and
returning EXIT_SUCCESS all the time.
- Remove another case where it checks the device passed string will be
the same than in bv_dev.
 1.3  05-Dec-2007  xtraeme Do not enforce that passed device string will be the same than the
one in bv_dev, which in some drivers like arcmsr(4) it contains the
volume name.

While I'm here, fix the formatting output so that it fits with arcmsr(4),
like:

$ sudo bioctl -h arcmsr0
Volume Status Size Device
arcmsr0 0 Building 698G ARC-1210-VOL#00 RAID5 96% done
0 Online 234G 0:0.0 noencl <WDC WD2500YS-01SHB1 20.06C06>
1 Online 234G 0:1.0 noencl <WDC WD2500YS-01SHB1 20.06C06>
2 Online 234G 0:2.0 noencl <WDC WD2500YS-01SHB1 20.06C06>
3 Online 234G 0:3.0 noencl <WDC WD2500YS-01SHB1 20.06C06>
$
 1.2  04-Nov-2007  xtraeme - Remove the code for softraid, it's unlikely that NetBSD will support
this because we do have a working raidframe(4).
- Miscellaneous cleanups and make the code WARNS=4 compliant.
- Removed all stuff that doesn't apply to NetBSD.
 1.1  01-May-2007  bouyer branches: 1.1.2; 1.1.6; 1.1.8;
Add bio(4) and associated bioctl(8) from OpenBSD, a driver control block
device controllers, and more specifically raid controllers.
Add a new sensor type, ENVSYS_DRIVE, to report drive status. From OpenBSD.
Add bio and sysmon support to mfi(4). This allow userland to query
status for drives and logical volumes attached to a mfi(4) controller. While
there fix some debug printfs in mfi so they compile.
Add bio(4) to amd64 and i386 GENERIC.
 1.1.8.3  15-Oct-2007  riz Clean up after a mistake I made pulling up ticket #1838. We
really only need one copy of each new file. :-)
 1.1.8.2  15-Oct-2007  riz Pull up following revisions via patch (requested by bouyer in ticket #1838):
distrib/sets/lists/man/mi: revision 1.997
sbin/bioctl/strtonum.c: revision 1.1
sys/dev/Makefile: revision 1.25
sys/arch/amd64/conf/GENERIC: revision 1.139
sbin/bioctl/strtonum.h: revision 1.1
sys/dev/bio.c: revision 1.1
sbin/bioctl/bioctl.c: revision 1.1
share/man/man4/bio.4: revision 1.1
sbin/bioctl/bioctl.8: revision 1.1
sys/sys/envsys.h: revision 1.11
sbin/bioctl/bioctl.8: revision 1.3
sbin/bioctl/bioctl.8: revision 1.4
sys/arch/i386/conf/XEN2_DOM0: revision 1.25
distrib/sets/lists/base/mi: revision 1.704
sys/conf/majors: revision 1.34
share/man/man4/Makefile: revision 1.426
etc/MAKEDEV.tmpl: revision 1.86
sys/arch/i386/conf/GENERIC: revision 1.825
distrib/sets/lists/comp/mi: revision 1.1022
sys/conf/files: revision 1.839
usr.sbin/envstat/envstat.c: revision 1.24
sbin/Makefile: revision 1.105
sys/dev/ic/mfi.c: revision 1.4
sys/dev/biovar.h: revision 1.1
sys/dev/ic/mfivar.h: revision 1.4
sbin/bioctl/Makefile: revision 1.1
Fix typo.
Add bio(4) and associated bioctl(8) from OpenBSD, a driver control block
device controllers, and more specifically raid controllers.
Add a new sensor type, ENVSYS_DRIVE, to report drive status. From OpenBSD.
Add bio and sysmon support to mfi(4). This allow userland to query
status for drives and logical volumes attached to a mfi(4) controller. While
there fix some debug printfs in mfi so they compile.
Add bio(4) to amd64 and i386 GENERIC.
Add bio(4) and associated bioctl(8) from OpenBSD, a driver control block
device controllers, and more specifically raid controllers.
Add a new sensor type, ENVSYS_DRIVE, to report drive status. From OpenBSD.
Add bio and sysmon support to mfi(4). This allow userland to query
status for drives and logical volumes attached to a mfi(4) controller. While
there fix some debug printfs in mfi so they compile.
Add bio(4) to amd64 and i386 GENERIC.
Fix Dd argument (use full month names).
Use more markup.
Comment out references to safte(4) and softraid(4), which don't exist in
NetBSD.
Remove trailing whitespace.
Use macros instead of characters for HTML output (replace ">", "<"
with \*[Gt], \*[Lt]).
Sort sections.
Create /dev/bio
 1.1.8.1  01-May-2007  riz file bioctl.c was added on branch netbsd-3 on 2007-10-15 05:09:51 +0000
 1.1.6.3  23-Mar-2008  matt sync with HEAD
 1.1.6.2  09-Jan-2008  matt sync with HEAD
 1.1.6.1  06-Nov-2007  matt sync with HEAD
 1.1.2.3  29-Aug-2008  bouyer Apply patch, requested by christos in tickets #1175:
sys/dev/bio.c patch
sys/dev/biovar.h patch
sys/dev/pci/arcmsr.c patch
sys/dev/pci/arcmsrvar.h patch
sbin/bioctl/Makefile patch
sbin/bioctl/bioctl.8 patch
sbin/bioctl/bioctl.c patch
sbin/bioctl/dehumanize_number.c patch
sbin/bioctl/strtonum.c patch
sbin/bioctl/strtonum.h patch

Port bioctl(8) and arcmsr(4) from current:
bioctl(8): Rewritten to handle new features like creating/removing
hot-spare, pass-through disks and RAID volumes, start/stop
consistency checks in volumes and others.
arcmsr(4): Added support to create/remove hot-spare, pass-through
disks and RAID volumes, start/stop consistency checks
in volumes as well as showing information about physical
disks (even if they are marked as hot-spare, pass-through
or unused).
 1.1.2.2  08-May-2007  pavel branches: 1.1.2.2.2;
Pull up following revision(s) (requested by bouyer in ticket #603):
distrib/sets/lists/base/mi: revision 1.704
distrib/sets/lists/comp/mi: revision 1.1022
distrib/sets/lists/man/mi: revision 1.997
doc/CHANGES: revision 1.839
sbin/Makefile: patch
sbin/bioctl/Makefile: revision 1.1
sbin/bioctl/bioctl.8: revision 1.1
sbin/bioctl/bioctl.c: revision 1.1
sbin/bioctl/strtonum.c: revision 1.1
sbin/bioctl/strtonum.h: revision 1.1
share/man/man4/Makefile: revision 1.426
share/man/man4/bio.4: revision 1.1
sys/arch/amd64/conf/GENERIC: revision 1.139
sys/arch/i386/conf/GENERIC: revision 1.825
sys/arch/i386/conf/XEN2_DOM0: revision 1.25
sys/conf/files: revision 1.839
sys/conf/majors: patch
sys/dev/Makefile: revision 1.25
sys/dev/bio.c: patch
sys/dev/biovar.h: patch
sys/dev/ic/mfi.c: revision 1.4-1.5
sys/dev/ic/mfivar.h: revision 1.4
sys/sys/envsys.h: revision 1.11
usr.sbin/envstat/envstat.c: revision 1.24
Add bio(4) and associated bioctl(8) from OpenBSD, a driver control block
device controllers, and more specifically raid controllers.
Add a new sensor type, ENVSYS_DRIVE, to report drive status. From OpenBSD.
Add bio and sysmon support to mfi(4). This allow userland to query
status for drives and logical volumes attached to a mfi(4) controller. While
there fix some debug printfs in mfi so they compile.
Add bio(4) to amd64 and i386 GENERIC.

note bio(4), envsys(4) DRIVE, and mfi(4) support for both.

tred->sensor is a u_int.
 1.1.2.1  01-May-2007  pavel branches: 1.1.2.1.2;
file bioctl.c was added on branch netbsd-4 on 2007-05-08 10:45:03 +0000
 1.1.2.2.2.1  04-Sep-2008  skrll Sync with netbsd-4.
 1.1.2.1.2.1  01-May-2007  skrll file bioctl.c was added on branch netbsd-4 on 2008-09-04 08:46:43 +0000
 1.6.2.2  18-Feb-2008  mjf Sync with HEAD.
 1.6.2.1  07-Dec-2007  mjf file bioctl.c was added on branch mjf-devfs on 2008-02-18 21:04:16 +0000
 1.7.4.1  03-Apr-2008  mjf Sync with HEAD.
 1.7.2.1  24-Mar-2008  keiichi sync with head.
 1.15.20.1  14-May-2015  snj Pull up following revision(s) (requested by joerg in ticket #758):
bin/ksh/Makefile: revision 1.31
bin/ps/print.c: revision 1.123
external/bsd/iscsi/dist/src/lib/parameters.c: revision 1.4
external/bsd/iscsi/dist/src/lib/target.c: revision 1.9
external/gpl2/lvm2/dist/lib/commands/toolcontext.c: revision 1.8
external/gpl2/lvm2/dist/lib/format1/import-export.c: revision 1.2
gnu/dist/texinfo/makeinfo/xml.c: revision 1.2
sbin/bioctl/bioctl.c: revision 1.16
usr.sbin/isdn/isdnd/msghdl.c: revision 1.12
Drop pointer checks that are always true.
--
Comment out impossible code.
--
Remove tautologic check.
--
Skip vendor if the string is empty.
Use l_wmesg if the string is not empty. Don't bother checking l_name for
nullness.
--
Array can't be null.
--
Show display if it is not empty.
--
Make cast warnings for clang non-fatal.
 1.17.16.1  10-Jun-2019  christos Sync with HEAD
 1.17.8.1  15-May-2022  martin Pull up following revision(s) (requested by msaitoh in ticket #1741):

sbin/bioctl/bioctl.c: revision 1.19

bioctl(8): Don't print garbage bv_seconds.

This bug was added in bioctl.c rev. 1.7.

Before:
Volume Status Size Device/Label Level Stripe
 1.18.2.1  14-May-2022  martin Pull up following revision(s) (requested by msaitoh in ticket #1449):

sbin/bioctl/bioctl.c: revision 1.19

bioctl(8): Don't print garbage bv_seconds.

This bug was added in bioctl.c rev. 1.7.

Before:
Volume Status Size Device/Label Level Stripe

RSS XML Feed