Commit Graph

7253 Commits

Author SHA1 Message Date
Jim Harris
a4acc8c3df Add separate *_usage() functions for each nvmecontrol command.
Sponsored by:	Intel
MFC after:	3 days
2013-06-26 22:53:21 +00:00
Jim Harris
eadf2a44c2 Add an open_dev() helper function to be used in the various places
where nvmecontrol needs to open a handle to a controller or namespace
device node.

Sponsored by:	Intel
MFC after:	3 days
2013-06-26 22:50:49 +00:00
Hiroki Sato
db3fdd7f63 - Use length of _PATH_DEV instead of a hardcoded value[*].
- Use MD_NAME for "md".

Pointed out by:	trasz [*]
MFC after:	1 week
2013-06-21 01:47:22 +00:00
Hiroki Sato
dc017e3401 eturn -1 when the specified backing store file is not found in the md
device list.

MFC after:	1 week
2013-06-20 17:01:02 +00:00
Hiroki Sato
b78ae23fdd - Add "-f file" support to listing mode (-l). When a -f option is
specified, only md(4) devices which have the specified file as backing
  store are displayed.
- Use MD_NAME instead of "md".
- Use _PATH_DEV instead of "/dev/".

MFC after:	1 week
2013-06-20 14:30:16 +00:00
Ed Schouten
87f02f6f89 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
Alexander Motin
126690fec1 Improve firmware download status check. Previous check was insufficient for
ATA since it ignored transport errors like command timeouts, while for SCSI
it was just wrong.
2013-06-14 08:26:58 +00:00
Alexander Motin
2c3ba49168 Fix build after r251654. 2013-06-12 19:21:23 +00:00
Alexander Motin
3c2305c3a5 Use CAM_DIR_NONE for requests without data.
Wrong values there confuse some drivers.

MFC after:	1 week
2013-06-12 16:13:05 +00:00
Florian Smeets
e1de133c2e Move the check whether the clear flag is set. This has 2 advantages
- When operating on a core file (-M) and -c is specified we don't clear
  the message buffer of the running system.
- If we don't have permission to clear the buffer print the error message
  only. That's what Linux does in this case, where this feature was ported
  from, and it ensures that the error message doesn't get lost in the noise.

Discussed with:	antoine, cognet
Approved by:	cognet
2013-06-11 17:46:32 +00:00
Marcel Moolenaar
3bd22a9cc8 Change the set and unset ctlreqs by making the index argument optional.
This allows setting attributes on tables. One simply does not provide
an index in that case. Otherwise the entry corresponding the index has
the attribute set or unset.

Use this change to fix a relatively longstanding bug in our GPT scheme
that's the result of rev 198097 (relatively harmless) followed by rev
237057 (damaging). The damaging part being that our GPT scheme always
has the active flag set on the PMBR slice. This is in violation with
EFI. Existing EFI implementions for both x86 and ia64 reject the GPT.
As such, GPT disks created by us aren't usable under EFI because of
that.

After this change, GPT disks never have the active flag set on the PMBR
slice. In order to make the GPT disk bootable under some x86 BIOSes,
the reason of rev 198097, one must now set the active attribute on the
gpt table. The kernel will apply this to the PMBR slice For (S)ATA:
	gpart set -a active ada0

To fix an existing GPT disk that has the active flag set in the PMBR,
and that does not need the flag, use (again for (S)ATA):
	gpart unset -a active ada0

The EBR, MBR & PC98 schemes, which also impement at least 1 attribute,
now check to make sure the entry passed is valid. They do not have
attributes that apply to the table.
2013-06-09 23:34:26 +00:00
Hiroki Sato
7df84c2b74 Fix a bug that the gateway address was not shown when a -gateway modifier
was used.
2013-06-09 17:40:06 +00:00
Jaakko Heinonen
4feadec3c4 Revert r238399.
The "failok" option doesn't have any effect at all unless specified in
fstab(5) and combined with the -a flag. The "failok" option is already
documented in fstab(5).

PR:		177630
No objection:	eadler
MFC after:	1 week
2013-06-07 07:17:46 +00:00
Jung-uk Kim
eb8b73d6ae Improve compatibility with old flex and fix build with GCC. 2013-05-22 17:47:45 +00:00
Alexander V. Chernikov
21278efe5b Fix ipfw(8) sets of ipv6 addresses handling.
Conditionally use stack buffer instead of calling strdup().

PR:		bin/104921
MFC after:	2 weeks
2013-05-18 04:49:00 +00:00
Xin LI
1b83e8a3f8 Constify string pointers.
Verified with:	sha256(1)
MFC after:	2 weeks
2013-05-16 21:04:56 +00:00
Kirk McKusick
9d384d4d3d When running the -m option to generate a newfs(8) command suitable for
recreating the filesystem, check for and output the -i, -k, and -l
options if appropriate.

Note the remaining deficiencies of the -m option in the dumpfs(8)
manual page. Specifically that newfs(8) options -E, -R, -S, and -T
options are not handled and that -p is not useful so is omitted.
Also document that newfs(8) options -n and -r are neither checked
for nor output but should be. The -r flag is needed if the filesystem
uses gjournal(8).

PR:           bin/163992
Reported by:  Dieter <freebsd@sopwith.solgatos.com>
Submitted by: Andy Kosela <akosela@andykosela.com>
MFC after:    1 week
2013-05-16 20:07:08 +00:00
Kirk McKusick
3e8b845956 Clean up trailing whitespace.
Submitted by: Andy Kosela
MFC after:    1 week
2013-05-16 19:39:11 +00:00
Alan Somers
8a20d4d1f4 sbin/camcontrol/camcontrol.c
If an expander returns 0x00 (no device attached) in the ATTACHED DEVICE
	field of the SMP DISCOVER response, ignore the value of ATTACHED SAS
	ADDRESS, because it is invalid.  Some expanders zero out the address
	when the attached device is removed, but others do not.  Section
	9.4.3.10 of the SAS Protocol Layer 2 revision 04b does not require them
	to do so.

Approved by:	ken (mentor)
MFC after:	3 weeks
2013-05-15 17:26:50 +00:00
Joel Dahl
37b983c09b mdoc sweep 2013-05-13 18:13:50 +00:00
Joel Dahl
2710751bc3 mdoc sweep. 2013-05-12 22:22:12 +00:00
Mikolaj Golub
1df892f44c 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
Eitan Adler
a93b9b7d11 Bump .Dd for recent content change.
Reported by:	delphij
2013-05-10 12:49:16 +00:00
Eitan Adler
11967f3ce1 Add support for 'dmesg -c' which clears the dmesg buffer after it has
been printed.  This provides compatibility with other *nix systems
(including Linux).

While here use stdbool booleans for 'all'.

PR:		bin/178295
Submitted by:	Levent Serinol <lserinol@gmail.com>
Reviewed by:	will
2013-05-10 03:42:48 +00:00
Joel Dahl
b266cbe17d Remove EOL whitespace. 2013-05-08 21:04:19 +00:00
Joel Dahl
8495c3d9a7 mdoc: new sentence, new line. 2013-05-08 21:02:48 +00:00
Adrian Chadd
e6e5db845a Add vlan configuration support to etherswitchcfg.
This adds the support to the config keyword (vlan operation mode), ports
flags, prints the vlan mode and vlan capabilities. It also adds some basic
information to usage() and support the keyword 'help' as a shortcut to
usage(). The manual page is also updated with the new options.

Submitted by:	Luiz Otavio O Souza <loos.br@gmail.com>
Reviewed by:	ray
2013-05-08 20:52:22 +00:00
Eitan Adler
63efd0a107 Allow the use of lowercase 'yes'
PR:		bin/178422
Submitted by:	Garrett Cooper <yaneurabeya@gmail.com>
2013-05-08 18:55:38 +00:00
Eitan Adler
9e2b4b0da3 Remove includes for old versions of FreeBSD.
Reviewed by:	stass
Obtained From:	DragonFlyBSD
MFC After:	1 week
2013-05-06 17:44:12 +00:00
Hiroki Sato
5df1b6b57e Use FF02:0:0:0:0:2:FF00::/104 prefix for IPv6 Node Information Group
Address.  Although KAME implementation used FF02:0:0:0:0:2::/96 based on
older versions of draft-ietf-ipngwg-icmp-name-lookup, it has been changed
in RFC 4620.

The kernel always joins the /104-prefixed address, and additionally does
/96-prefixed one only when net.inet6.icmp6.nodeinfo_oldmcprefix=1.
The default value of the sysctl is 1.

ping6(8) -N flag now uses /104-prefixed one.  When this flag is specified
twice, it uses /96-prefixed one instead.

Reviewed by:		ume
Based on work by:	Thomas Scheffler
PR:			conf/174957
MFC after:		2 weeks
2013-05-04 19:16:26 +00:00
Chris Rees
b48b774f99 Introduce and use new flag -L to mount for mounting only late filesystems.
Previously, rc.d/mountlate mounted *all* filesystems, causing problems with
background NFS mounts being mounted twice.

PR:		conf/137629
Submitted by:	eadler (original concept)
Reviewed by:	mjg
Approved by:	hrs
2013-05-04 14:00:16 +00:00
Jung-uk Kim
a7880d59c9 Improve compatibility with recent flex from flex.sourceforge.net. 2013-05-03 23:51:32 +00:00
Eitan Adler
d005340fe9 Prefer using the C++ version of the standard headers. These place the
names within the std namespace (and possibly within the global
namespace).

The main advantage is that the C++ versions can provide optimized
versions or simplified interfaces.
2013-05-02 17:02:50 +00:00
Joel Dahl
4684a6ef0c Adapt to the fact that minidumps are now on by default.
PR:		177188
2013-04-30 07:22:03 +00:00
Dag-Erling Smørgrav
5c6fe3a917 Style nit. 2013-04-29 20:14:11 +00:00
Dag-Erling Smørgrav
2b5373de83 Add a -Z option which zeroes unused blocks. It can be combined with -E,
in which case unused blocks are first zeroed and then erased.

Reviewed by:	mckusick
MFC after:	3 weeks
2013-04-29 20:13:09 +00:00
Ed Schouten
24084cdd91 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 Schouten
6e87c1514b Use C11 <stdatomic.h> instead of our non-standard <machine/atomic.h>.
Reviewed by:	pjd
2013-04-27 05:01:29 +00:00
Alan Somers
0425e01683 According to devctl(4), clients must read events whole; they may not
piece them together from multiple reads().  It's as if /dev/devctl is
a datagram device instead of a stream device.  However, devd's
internal buffer was too small (1025 bytes) to read an entire
ereport.fs.zfs.checksum event (variable, up to ~1300 bytes).  This
commit enlarges the buffer to 8k.

Reviewed by:	imp
Approved by:	ken (mentor)
MFC after:	2 weeks
2013-04-26 19:49:37 +00:00
Joel Dahl
452025cfc6 mdoc: remove superfluous paragraph macro. 2013-04-25 20:23:22 +00:00
Gleb Smirnoff
ab210b8057 Don't free memory that is going to be used as error string.
PR:		bin/178121
Submitted by:	Garrett Cooper <yaneurabeya gmail.com>
2013-04-25 16:34:04 +00:00
Steven Hartland
9e68761ce0 Adds Host Protected Area (HPA) support for ATA disks to camcontrol
Reviewed by:	mav
Approved by:	pjd (mentor)
MFC after:	2 weeks
2013-04-25 14:11:38 +00:00
Kirk McKusick
244dccb7fd Fix error check.
Submitted by: Andrey Chernov (ache@)
MFC after: 3 days
2013-04-23 06:37:50 +00:00
Joel Dahl
6c4b7d71f1 Minor clarificiation.
PR:		177455
2013-04-22 17:38:26 +00:00
John Baldwin
9291a1cd14 Use a higher TTL (128) for DHCP packets. This matches the ISC DHCP client.
PR:		bin/170279
MFC after:	1 week
2013-04-22 15:02:32 +00:00
Adrian Chadd
a321935999 Convert over the etherswitch framework to use VLAN IDs per port, rather
than VLAN groups.

Some chips (eg this rtl8366rb) has a VLAN group per port - you first
define a set of VLANs in a vlan group, then you assign a VLAN group
to a port.

Other chips (eg the AR8xxx switch chips) have a VLAN ID array per
port - there's no group per se, just a list of vlans that can be
configured.

So for now, the switch API will use the latter and rely on drivers
doing the heavy lifting if one wishes to use the VLAN group method.
Maybe later on both can be supported.

PR:		kern/177878
PR:		kern/177873
Submitted by:	Luiz Otavio O Souza <loos.br@gmail.com>
Reviewed by:	ray
2013-04-22 05:52:18 +00:00
Adrian Chadd
cdf0868a3d etherswitchcfg(8) crashes when you don't set vlangroup members.
Fix this to require an argument.

PR:		kern/177872
Submitted by:	Luiz Otavio O Souza <loos.br@gmail.com>
2013-04-22 05:30:20 +00:00
Adrian Chadd
e1d6379074 Initialise this to zero before using it to configure the vlangroup
information.

PR:		kern/177871
Submitted by:	Luiz Otavio O Souza <loos.br@gmail.com>
2013-04-22 05:27:13 +00:00
Ed Schouten
4f929487f3 Unbreak the build of newfs_nandfs.
Mark global variables static. While there, make some small style(9)
cleanups and remove a variable that is unused.
2013-04-21 22:36:14 +00:00
Mikolaj Golub
f7854e9247 Remove code duplication. 2013-04-21 20:51:53 +00:00