History log of /freebsd-current/sbin/hastctl/hastctl.c
Revision Date Author Comments
# 32e86a82 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

sbin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 1de7b4b8 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.


# 6b66c350 26-Oct-2013 Mikolaj Golub <trociny@FreeBSD.org>

Make hastctl list command output current queue sizes.

Reviewed by: pjd
MFC after: 1 month


# 14f200d9 01-Jul-2013 Mikolaj Golub <trociny@FreeBSD.org>

Make hastctl(1) ('list' command) output a worker pid.

Reviewed by: pjd
MFC after: 3 days


# f7854e92 21-Apr-2013 Mikolaj Golub <trociny@FreeBSD.org>

Remove code duplication.


# 5632176c 14-Mar-2013 Dmitry Morozovsky <marck@FreeBSD.org>

Rename 'status' command to 'list' and introduce new 'status' which produces
more terse output more observable for both scripts and humans.

Also, it shifts hastctl closer to GEOM utilities with their list/status command
pairs.

Approved by: pjd
MFC after: 4 weeks


# 2ee08bd1 14-Mar-2013 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Removed redundant includes.


# 6559a21f 26-Feb-2013 Mikolaj Golub <trociny@FreeBSD.org>

Fix casting.

MFC after: 3 days


# 2adbba66 25-Feb-2013 Mikolaj Golub <trociny@FreeBSD.org>

Add i/o error counters to hastd(8) and make hastctl(8) display
them. This may be useful for detecting problems with HAST disks.

Discussed with and reviewed by: pjd
MFC after: 1 week


# 2b1b224d 10-Jan-2012 Pawel Jakub Dawidek <pjd@FreeBSD.org>

For functions that return -1 on failure check exactly for -1 and not for
any negative number.

MFC after: 3 days


# 00bddd18 27-Sep-2011 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Prefer PJDLOG_ASSERT()/PJDLOG_ABORT() over assert().

MFC after: 3 days


# 1332d29c 12-Jul-2011 Mikolaj Golub <trociny@FreeBSD.org>

When exiting with error because of an invalid command line argument
use errx(3), not err(3), and the exit code from sysexits(3).

Approved by: pjd (mentor)


# 3db86c39 23-May-2011 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Keep statistics on number of BIO_READ, BIO_WRITE, BIO_DELETE and BIO_FLUSH
requests as well as number of activemap updates.

Number of BIO_WRITEs and activemap updates are especially interesting, because
if those two are too close to each other, it means that your workload needs
bigger number of dirty extents. Activemap should be updated as rarely as
possible.

MFC after: 1 week


# 0cddb12f 14-May-2011 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Currently we are unable to use capsicum for the primary worker process,
because we need to do ioctl(2)s, which are not permitted in the capability
mode. What we do now is to chroot(2) to /var/empty, which restricts access
to file system name space and we drop privileges to hast user and hast
group.

This still allows to access to other name spaces, like list of processes,
network and sysvipc.

To address that, use jail(2) instead of chroot(2). Using jail(2) will restrict
access to process table, network (we use ip-less jails) and sysvipc (if
security.jail.sysvipc_allowed is turned off). This provides much better
separation.

MFC after: 1 week


# 610bc6ae 26-Apr-2011 Mikolaj Golub <trociny@FreeBSD.org>

Fix assert messages.

Approved by: pjd (mentor)


# 64acad05 17-Apr-2011 Mikolaj Golub <trociny@FreeBSD.org>

Remove hast_proto_recv(). It was used only in one place, where
hast_proto_recv_hdr() may be used. This also fixes the issue
(introduced by r220523) with hastctl, which crashed on assert in
hast_proto_recv_data().

Suggested and approved by: pjd (mentor)


# 4d8dc3b8 21-Mar-2011 Pawel Jakub Dawidek <pjd@FreeBSD.org>

When dropping privileges prefer capsicum over chroot+setgid+setuid.
We can use capsicum for secondary worker processes and hastctl.
When working as primary we drop privileges using chroot+setgid+setuid
still as we need to send ioctl(2)s to ggate device, for which capsicum
doesn't allow (yet).

X-MFC after: capsicum is merged to stable/8


# 4b6b8dd6 21-Mar-2011 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Forgot to commit this as a part of r219818.

MFC after: 1 week


# e7272ff3 13-Mar-2011 Mikolaj Golub <trociny@FreeBSD.org>

In command line options allow size to be specified using k/M/G/T
suffixes.

Approved by: pjd (mentor)
MFC after: 1 week


# dd5759bf 07-Mar-2011 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Print some of the numbers in human readable form (using %N).

MFC after: 2 weeks


# 7cf48ac8 03-Feb-2011 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Drop privileges after connecting to hastd, but before sending or receiving
anything.

MFC after: 1 week


# 5a1caf9a 02-Feb-2011 Bjoern A. Zeeb <bz@FreeBSD.org>

Add missing argument after r218192.


# eeb3cd67 27-Jan-2011 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Add functions to initialize/finalize pjdlog. This allows to open/close log
file at will.

MFC after: 1 week


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 36d8ab97 05-Aug-2010 Doug Barton <dougb@FreeBSD.org>

Update the arguments to yy_config_parse() to match r210883.

Choose the more conservative option ('yes' to exit on error) to match
the equivalent code in hastd.


# 2b98f840 18-Apr-2010 Pawel Jakub Dawidek <pjd@FreeBSD.org>

MFC r204076,r204077,r204083,r205279:

r204076:

Please welcome HAST - Highly Avalable Storage.

HAST allows to transparently store data on two physically separated machines
connected over the TCP/IP network. HAST works in Primary-Secondary
(Master-Backup, Master-Slave) configuration, which means that only one of the
cluster nodes can be active at any given time. Only Primary node is able to
handle I/O requests to HAST-managed devices. Currently HAST is limited to two
cluster nodes in total.

HAST operates on block level - it provides disk-like devices in /dev/hast/
directory for use by file systems and/or applications. Working on block level
makes it transparent for file systems and applications. There in no difference
between using HAST-provided device and raw disk, partition, etc. All of them
are just regular GEOM providers in FreeBSD.

For more information please consult hastd(8), hastctl(8) and hast.conf(5)
manual pages, as well as http://wiki.FreeBSD.org/HAST.

Sponsored by: FreeBSD Foundation
Sponsored by: OMCnet Internet Service GmbH
Sponsored by: TransIP BV

r204077:

Remove some lines left over by accident.

r204083:

Add missing KEYWORD line.

Pointed out by: dougb

r205279 sys:

Simplify loops.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# 32115b10 18-Feb-2010 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Please welcome HAST - Highly Avalable Storage.

HAST allows to transparently store data on two physically separated machines
connected over the TCP/IP network. HAST works in Primary-Secondary
(Master-Backup, Master-Slave) configuration, which means that only one of the
cluster nodes can be active at any given time. Only Primary node is able to
handle I/O requests to HAST-managed devices. Currently HAST is limited to two
cluster nodes in total.

HAST operates on block level - it provides disk-like devices in /dev/hast/
directory for use by file systems and/or applications. Working on block level
makes it transparent for file systems and applications. There in no difference
between using HAST-provided device and raw disk, partition, etc. All of them
are just regular GEOM providers in FreeBSD.

For more information please consult hastd(8), hastctl(8) and hast.conf(5)
manual pages, as well as http://wiki.FreeBSD.org/HAST.

Sponsored by: FreeBSD Foundation
Sponsored by: OMCnet Internet Service GmbH
Sponsored by: TransIP BV