Commit Graph

316 Commits

Author SHA1 Message Date
trociny
5092fcd640 Make hastctl(1) ('list' command) output a worker pid.
Reviewed by:	pjd
MFC after:	3 days
2013-07-01 18:41:07 +00:00
schweikh
19b98edeaa Correct some grammar. 2013-06-30 17:59:40 +00:00
ed
3764c06cce Don't let hastd use C11 atomics.
Due to possible concerns about the stability of C11 atomics, use our
existing atomics API instead.

Requested by:	pjd
2013-06-29 20:13:39 +00:00
ed
4ea862e26e Let hastd use C11 atomics.
C11 atomics now work on all the architectures. Have at least a single
piece of software in our base system that uses C11 atomics. This
somewhat makes it less likely that we break it because of LLVM imports,
etc.
2013-06-15 22:17:59 +00:00
jkim
d752b745df Improve compatibility with old flex and fix build with GCC. 2013-05-22 17:47:45 +00:00
trociny
f39c963dc2 Get rid of libl dependency. We needed it only to provide yywrap. But
yywrap is not necessary when parsing a single hast.conf file.

Suggested by:	kib
Reviewed by:	pjd
2013-05-11 09:51:44 +00:00
ed
a09c9f5550 Partially revert my last change.
I forgot that I still had a locally applied patch to my copy of Clang
that needs to be pushed in before we should use C11 atomics.
2013-04-27 05:06:25 +00:00
ed
e802849740 Use C11 <stdatomic.h> instead of our non-standard <machine/atomic.h>.
Reviewed by:	pjd
2013-04-27 05:01:29 +00:00
ed
120125784a Add the Clang specific -Wmissing-variable-declarations to WARNS=6.
This compiler flag enforces that that people either mark variables
static or use an external declarations for the variable, similar to how
-Wmissing-prototypes works for functions.

Due to the fact that Yacc/Lex generate code that cannot trivially be
changed to not warn because of this (lots of yy* variables), add a
NO_WMISSING_VARIABLE_DECLARATIONS that can be used to turn off this
specific compiler warning.

Announced on:	toolchain@
2013-04-19 19:45:00 +00:00
pjd
3d6eb97a85 Now that ioctl(2) is allowed in capability mode and we can limit ioctls for the
given descriptors, use Capsicum sandboxing for hastd in primary and secondary
modes. Allow for DIOCGDELETE and DIOCGFLUSH ioctls on provider descriptor and
for G_GATE_CMD_MODIFY, G_GATE_CMD_START, G_GATE_CMD_DONE and G_GATE_CMD_DESTROY
on GEOM Gate descriptor.

Sponsored by:	The FreeBSD Foundation
2013-03-14 23:14:47 +00:00
pjd
aa00097868 Minor corrections. 2013-03-14 23:11:52 +00:00
pjd
5f4ba049f3 Delete requests can be larger than MAXPHYS. 2013-03-14 23:03:48 +00:00
trociny
8690e69f6a 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
2013-02-25 20:09:07 +00:00
pjd
0bf19fd812 - Add support for 'memsync' mode. This is the fastest replication mode that's
why it will now be the default.
- Bump protocol version to 2 and add backward compatibility for version 1.
- Allow to specify hosts by kern.hostid as well (in addition to hostname and
  kern.hostuuid) in configuration file.

Sponsored by:	Panzura
Tested by:	trociny
2013-02-17 21:12:34 +00:00
kevlo
804c67a486 Fix socket calls on error post-r243965.
Submitted by:	Garrett Cooper
2012-12-21 15:54:13 +00:00
pjd
712fa475ac Revert r228695. We use __func__ here as a format to distinguish between
abort and assert. It would be cleaner to use NULL or "" here, but gcc
complains in both cases.
2012-11-05 00:38:14 +00:00
trociny
48789932a6 Metaflush on/off values don't need quotes.
Reviewed by:	pjd
MFC after:	3 days
2012-07-16 20:43:28 +00:00
pjd
1fb1092d75 Make use of GEOM Gate direct reads feature. This allows HAST to serve
reads with native speed of the underlying provider.
There are three situations when direct reads are not used:
1. Data is being synchronized and synchronization source is the secondary
   node, which means secondary node has more recent data and we should read
   from it.
2. Local read failed and we have to try to read from the secondary node.
3. Local component is unavailable and all I/O requests are served from the
   secondary node.

Sponsored by:	Panzura, http://www.panzura.com
MFC after:	1 month
2012-07-04 20:20:48 +00:00
pjd
c34c233e83 Check if there is cmsg at all.
MFC after:	3 days
2012-07-01 16:26:07 +00:00
hselasky
6a1a47c355 Revert: r236909
Pointyhat: me
2012-06-11 20:27:52 +00:00
hselasky
6b0d4730f1 Use the correct clock source when computing timeouts.
MFC after:	1 week
2012-06-11 19:20:59 +00:00
pjd
2143a387af Simplify the code by using snprlcat().
MFC after:	3 days
2012-06-03 10:50:46 +00:00
wblock
9fa9a2acad Fixes to man8 groff mandoc style, usage mistakes, or typos.
PR:		168016
Submitted by:	Nobuyuki Koganemaru
Approved by:	gjb
MFC after:	3 days
2012-05-24 02:24:03 +00:00
bapt
310ab6d7ff Fix world after byacc import:
- old yacc(1) use to magicially append stdlib.h, while new one don't
- new yacc(1) do declare yyparse by itself, fix redundant declaration of
  'yyparse'

Approved by:	des (mentor)
2012-05-22 16:33:10 +00:00
gjb
67d88d49d4 General mdoc(7) and typo fixes.
PR:		167804
Submitted by:	Nobuyuki Koganemaru (kogane!jp.freebsd.org)
MFC after:	3 days
2012-05-12 15:08:22 +00:00
trociny
5780d99776 If hastd is invoked with "-P pidfile" option always create pidfile
regardless of whether -F (foreground) option is set or not.

Also, if -P option is specified, ignore pidfile setting from configuration
not only on start but on reload too. This fixes the issue when for hastd
run with -P option reload caused the pidfile change.

Reviewed by:	pjd
MFC after:	1 week
2012-03-29 20:11:16 +00:00
trociny
4eba690e91 Fix typo.
MFC after:	3 days
2012-03-23 20:18:48 +00:00
pjd
3e86e21237 Nice range comparison.
MFC after:	3 days
2012-02-11 16:41:52 +00:00
trociny
1d510ea553 If a local write request is from the synchronization thread, when it
is synchronizing data that is out of date on the local component, we
should not send G_GATE_CMD_DONE acknowledge to the kernel.

This fixes the issue, observed in async mode, when on synchronization
from the remote component the worker terminated with "G_GATE_CMD_DONE
failed" error.

Reported by:	Artem Kajalainen <artem kayalaynen ru>
Reviewed by:	pjd
MFC after:	1 week
2012-02-05 15:23:32 +00:00
trociny
d2786f0a2c Fix the regression introduced in r226859: if the local component is
out of date BIO_READ requests got lost instead of being sent to the
remote component.

Reviewed by:	pjd
MFC after:	1 week
2012-02-05 15:21:08 +00:00
pjd
306b4958cf Fix typo in comment.
MFC after:	3 days
2012-02-04 07:59:12 +00:00
pjd
538ff2e745 - Fix documentation to note that /etc/hast.conf is the default configuration
file for hastd(8) and hastctl(8) and not hast.conf.
- In copyright statement correct that this file is documentation, not software.
- Bump date.

MFC after:	3 days
2012-01-24 23:43:13 +00:00
pjd
983cddf8a6 Free memory that won't be used in child.
MFC after:	1 week
2012-01-22 11:20:42 +00:00
pjd
bf37868a59 Fix minor memory leak.
MFC after:	3 days
2012-01-21 20:13:37 +00:00
pjd
62f2fd64bb Remove another unused token.
MFC after:	3 days
2012-01-20 21:49:56 +00:00
pjd
8e6c8deb43 Remove unused token 'port'.
MFC after:	3 days
2012-01-20 21:45:24 +00:00
pjd
b07aec8b25 Style cleanups.
MFC after:	3 days
2012-01-13 23:25:35 +00:00
pjd
e437b28043 - Fix a bug where pidfile was removed in SIGHUP when it hasn't changed in
configuration file.
- Log the fact that pidfile has changed.

MFC after:	3 days
2012-01-10 22:41:09 +00:00
pjd
c5fe5a76f2 For functions that return -1 on failure check exactly for -1 and not for
any negative number.

MFC after:	3 days
2012-01-10 22:39:07 +00:00
pjd
29f76d890e Don't touch pidfiles when running in foreground. Before that change we
would create an empty pidfile on start and check if it changed on SIGHUP.

MFC after:	3 days
2012-01-10 22:24:57 +00:00
uqs
5f1ca9b982 Spelling fixes for sbin/ 2012-01-07 16:09:33 +00:00
pjd
cbcf1832ad fork(2) returns -1 on failure, not some random negative number.
MFC after:	3 days
2012-01-06 23:44:26 +00:00
pjd
a272071bf0 Constify argument.
MFC after:	3 days
2012-01-06 12:27:17 +00:00
dim
9d35683411 Use NO_WCAST_ALIGN for usr.bin/hastctl and usr.bin/hastd; the alignment
warnings in sbin/hastd/lzf.c are only emitted for i386 and amd64, and
there they can be safely ignored.

MFC after:	1 week
2011-12-19 15:46:15 +00:00
pjd
0283ff3e72 Use lex's standard way of not generating unused function.
Inspired by:	r228555
MFC after:	1 week
2011-12-18 20:41:58 +00:00
pjd
509e6459e0 Don't use function name as format string.
Detected by:	clang
MFC after:	1 week
2011-12-18 20:40:19 +00:00
pjd
8d73b322fa Remove redundant assignment.
Found by:	Clang Static Analyzer
MFC after:	1 week
2011-12-15 22:05:23 +00:00
pjd
91f3438889 Simplify code by changing functions types from int to avoid, as the functions
always return 0.

Found by:	Clang Static Analyzer
MFC after:	1 week
2011-12-15 22:03:17 +00:00
pjd
a852ec0ef9 Remove redundant setting of the error variable.
Found by:	Clang Static Analyzer
MFC after:	1 week
2011-12-15 22:01:34 +00:00
pjd
f13dc0df13 Remove redundant space.
MFC after:	3 days
2011-10-27 20:36:35 +00:00