summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2013-10-13 02:35:19 +0000
committersjg <sjg@FreeBSD.org>2013-10-13 02:35:19 +0000
commit7fcd33c1faf567506b5c0b4148c7a15a10788a5d (patch)
tree2c6f4d1ca5d1c643faea64e1f4c90105a1ab406a /sbin
parent2a59274eda20cc626e28052fff7aa8b7bf6a3683 (diff)
parent5cca672bb0892f1c5da630c34a1f98e2de4d7064 (diff)
downloadFreeBSD-src-7fcd33c1faf567506b5c0b4148c7a15a10788a5d.zip
FreeBSD-src-7fcd33c1faf567506b5c0b4148c7a15a10788a5d.tar.gz
Merge head@256284
Diffstat (limited to 'sbin')
-rw-r--r--sbin/bsdlabel/bsdlabel.86
-rw-r--r--sbin/camcontrol/camcontrol.c2
-rw-r--r--sbin/camcontrol/fwdownload.c2
-rw-r--r--sbin/ccdconfig/ccdconfig.84
-rw-r--r--sbin/etherswitchcfg/etherswitchcfg.86
-rw-r--r--sbin/etherswitchcfg/etherswitchcfg.c4
-rw-r--r--sbin/fdisk/fdisk.84
-rw-r--r--sbin/gbde/gbde.816
-rw-r--r--sbin/geom/class/eli/geli.814
-rw-r--r--sbin/geom/class/shsec/gshsec.84
-rw-r--r--sbin/geom/class/virstor/gvirstor.88
-rw-r--r--sbin/gvinum/gvinum.828
-rw-r--r--sbin/hastd/hast.h4
-rw-r--r--sbin/hastd/primary.c34
-rw-r--r--sbin/hastd/secondary.c7
-rw-r--r--sbin/iscontrol/iscontrol.81
-rw-r--r--sbin/iscontrol/iscsi.conf.538
-rw-r--r--sbin/mount_msdosfs/mount_msdosfs.810
-rw-r--r--sbin/newfs/newfs.86
-rw-r--r--sbin/newfs_msdos/newfs_msdos.86
-rw-r--r--sbin/newfs_nandfs/newfs_nandfs.86
-rw-r--r--sbin/nvmecontrol/perftest.c12
-rw-r--r--sbin/recoverdisk/recoverdisk.110
-rw-r--r--sbin/route/route.c5
24 files changed, 119 insertions, 118 deletions
diff --git a/sbin/bsdlabel/bsdlabel.8 b/sbin/bsdlabel/bsdlabel.8
index e5e4714..d31187b 100644
--- a/sbin/bsdlabel/bsdlabel.8
+++ b/sbin/bsdlabel/bsdlabel.8
@@ -31,7 +31,7 @@
.\" @(#)disklabel.8 8.2 (Berkeley) 4/19/94
.\" $FreeBSD$
.\"
-.Dd March 5, 2011
+.Dd October 1, 2013
.Dt BSDLABEL 8
.Os
.Sh NAME
@@ -457,9 +457,9 @@ such as
and
.Cm * ,
which could be used as a source file for
-.Dq Li "bsdlabel -R ad0s1 new_label_file" :
+.Dq Li "bsdlabel -R ada0s1 new_label_file" :
.Bd -literal -offset 4n
-# /dev/ad0s1:
+# /dev/ada0s1:
8 partitions:
# size offset fstype [fsize bsize bps/cpg]
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c
index e80c549..68c6d79 100644
--- a/sbin/camcontrol/camcontrol.c
+++ b/sbin/camcontrol/camcontrol.c
@@ -2748,7 +2748,7 @@ atasecurity(struct cam_device *device, int retry_count, int timeout,
if (strcasecmp(optarg, "user") == 0) {
pwd.ctrl |= ATA_SECURITY_PASSWORD_USER;
pwd.ctrl &= ~ATA_SECURITY_PASSWORD_MASTER;
- } else if (strcasecmp(optarg, "master") != 0) {
+ } else if (strcasecmp(optarg, "master") == 0) {
pwd.ctrl |= ATA_SECURITY_PASSWORD_MASTER;
pwd.ctrl &= ~ATA_SECURITY_PASSWORD_USER;
} else {
diff --git a/sbin/camcontrol/fwdownload.c b/sbin/camcontrol/fwdownload.c
index 7e57d32..181c234 100644
--- a/sbin/camcontrol/fwdownload.c
+++ b/sbin/camcontrol/fwdownload.c
@@ -224,6 +224,7 @@ fw_read_img(const char *fw_img_path, const struct fw_vendor *vp, int *num_bytes)
goto bailout;
}
*num_bytes = img_size;
+ close(fd);
return (buf);
bailout:
free(buf);
@@ -286,6 +287,7 @@ fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp,
ata_28bit_cmd(&ccb->ataio, ATA_ATA_IDENTIFY, 0, 0, 0);
} else {
warnx("weird disk type '%s'", type);
+ cam_freeccb(ccb);
return 1;
}
/* Disable freezing the device queue. */
diff --git a/sbin/ccdconfig/ccdconfig.8 b/sbin/ccdconfig/ccdconfig.8
index 99a1762..977da81 100644
--- a/sbin/ccdconfig/ccdconfig.8
+++ b/sbin/ccdconfig/ccdconfig.8
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 17, 1995
+.Dd October 1, 2013
.Dt CCDCONFIG 8
.Os
.Sh NAME
@@ -180,7 +180,7 @@ and read it from
mdadm --create --chunk=32 --level=0 --raid-devices=2 /dev/md0 \\
/dev/hda1 /dev/hdb1
# Make the RAID-0 just created available on FreeBSD:
-ccdconfig -c /dev/ccd0 32 linux /dev/ad0s1 /dev/ad0s2
+ccdconfig -c /dev/ccd0 32 linux /dev/ada0s1 /dev/ada0s2
.Ed
.Pp
When you create a new ccd disk you generally want to
diff --git a/sbin/etherswitchcfg/etherswitchcfg.8 b/sbin/etherswitchcfg/etherswitchcfg.8
index a8b8d1a..9cdbdd6 100644
--- a/sbin/etherswitchcfg/etherswitchcfg.8
+++ b/sbin/etherswitchcfg/etherswitchcfg.8
@@ -1,5 +1,5 @@
.\" $FreeBSD$
-.Dd December 15, 2011
+.Dd September 20, 2013
.Dt ETHERSWITCHCFG 8
.Os
.Sh NAME
@@ -145,9 +145,9 @@ to indicate that frames on this port are tagged.
Control file for the ethernet switch driver.
.El
.Sh EXAMPLES
-Configure VLAN group 1 with a VID of 2 and makes ports 0 and 5 members,
+Configure VLAN group 1 with a VID of 2 and make ports 0 and 5 its members
while excluding all other ports.
-Port 5 will send and receive tagged frames, while port 0 will be untagged.
+Port 5 will send and receive tagged frames while port 0 will be untagged.
Incoming untagged frames on port 0 are assigned to vlangroup1.
.Dl # etherswitchcfg vlangroup1 vlan 2 members 0,5t port0 pvid 2
.Sh SEE ALSO
diff --git a/sbin/etherswitchcfg/etherswitchcfg.c b/sbin/etherswitchcfg/etherswitchcfg.c
index 1eef832..dd68e67 100644
--- a/sbin/etherswitchcfg/etherswitchcfg.c
+++ b/sbin/etherswitchcfg/etherswitchcfg.c
@@ -274,7 +274,7 @@ set_vlangroup_vid(struct cfg *cfg, char *argv[])
etherswitch_vlangroup_t vg;
v = strtol(argv[1], NULL, 0);
- if (v < 0 || v >= IEEE802DOT1Q_VID_MAX)
+ if (v < 0 || v > IEEE802DOT1Q_VID_MAX)
errx(EX_USAGE, "vlan must be between 0 and %d", IEEE802DOT1Q_VID_MAX);
vg.es_vlangroup = cfg->unit;
if (ioctl(cfg->fd, IOETHERSWITCHGETVLANGROUP, &vg) != 0)
@@ -623,7 +623,7 @@ main(int argc, char *argv[])
print_info(&cfg);
} else if (sscanf(argv[0], "port%d", &cfg.unit) == 1) {
if (cfg.unit < 0 || cfg.unit >= cfg.info.es_nports)
- errx(EX_USAGE, "port unit must be between 0 and %d", cfg.info.es_nports);
+ errx(EX_USAGE, "port unit must be between 0 and %d", cfg.info.es_nports - 1);
newmode(&cfg, MODE_PORT);
} else if (sscanf(argv[0], "vlangroup%d", &cfg.unit) == 1) {
if (cfg.unit < 0 || cfg.unit >= cfg.info.es_nvlangroups)
diff --git a/sbin/fdisk/fdisk.8 b/sbin/fdisk/fdisk.8
index 1764b64..fcab133 100644
--- a/sbin/fdisk/fdisk.8
+++ b/sbin/fdisk/fdisk.8
@@ -1,6 +1,6 @@
.\" $FreeBSD$
.\"
-.Dd May 24, 2009
+.Dd October 1, 2013
.Dt FDISK 8
.Os
.Sh NAME
@@ -159,7 +159,7 @@ mounted root device.
When called with no arguments, it prints the sector 0 slice table.
An example follows:
.Bd -literal
- ******* Working on device /dev/ad0 *******
+ ******* Working on device /dev/ada0 *******
parameters extracted from in-core disklabel are:
cylinders=769 heads=15 sectors/track=33 (495 blks/cyl)
diff --git a/sbin/gbde/gbde.8 b/sbin/gbde/gbde.8
index 96bbb60..efd3156 100644
--- a/sbin/gbde/gbde.8
+++ b/sbin/gbde/gbde.8
@@ -31,7 +31,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 8, 2006
+.Dd October 1, 2013
.Dt GBDE 8
.Os
.Sh NAME
@@ -207,23 +207,23 @@ used).
.Sh EXAMPLES
To initialize a device, using default parameters:
.Pp
-.Dl "gbde init /dev/ad0s1f -L /etc/ad0s1f.lock"
+.Dl "gbde init /dev/ada0s1f -L /etc/ada0s1f.lock"
.Pp
To attach an encrypted device:
.Pp
-.Dl "gbde attach ad0s1f -l /etc/ad0s1f.lock"
+.Dl "gbde attach ada0s1f -l /etc/ada0s1f.lock"
.Pp
The encrypted device has the suffix
.Pa .bde
so a typical
command to create and mount a file system would be:
.Pp
-.Dl "newfs /dev/ad0s1f.bde"
-.Dl "mount /dev/ad0s1f.bde /secret"
+.Dl "newfs /dev/ada0s1f.bde"
+.Dl "mount /dev/ada0s1f.bde /secret"
.Pp
To detach an encrypted device:
.Pp
-.Dl "gbde detach ad0s1f"
+.Dl "gbde detach ada0s1f"
.Pp
Please notice that detaching an encrypted device corresponds to
physically removing it, do not forget to unmount the file system first.
@@ -231,11 +231,11 @@ physically removing it, do not forget to unmount the file system first.
To initialize the second key using a detached lockfile and a trivial
pass-phrase:
.Pp
-.Dl "gbde setkey ad0s1f -n 2 -P foo -L key2.lockfile"
+.Dl "gbde setkey ada0s1f -n 2 -P foo -L key2.lockfile"
.Pp
To destroy all copies of the masterkey:
.Pp
-.Dl "gbde destroy ad0s1f -n -1"
+.Dl "gbde destroy ada0s1f -n -1"
.Sh SEE ALSO
.Xr gbde 4 ,
.Xr geom 4
diff --git a/sbin/geom/class/eli/geli.8 b/sbin/geom/class/eli/geli.8
index ad70798..55cf844 100644
--- a/sbin/geom/class/eli/geli.8
+++ b/sbin/geom/class/eli/geli.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 5, 2013
+.Dd October 1, 2013
.Dt GELI 8
.Os
.Sh NAME
@@ -841,10 +841,10 @@ Create an encrypted provider for use by the user, but remember that users
forget their passphrases, so backup the Master Key with your own random key:
.Bd -literal -offset indent
# dd if=/dev/random of=/mnt/pendrive/keys/`hostname` bs=64 count=1
-# geli init -P -K /mnt/pendrive/keys/`hostname` /dev/ad0s1e
-# geli backup /dev/ad0s1e /mnt/pendrive/backups/`hostname`
+# geli init -P -K /mnt/pendrive/keys/`hostname` /dev/ada0s1e
+# geli backup /dev/ada0s1e /mnt/pendrive/backups/`hostname`
(use key number 0, so the encrypted Master Key will be re-encrypted by this)
-# geli setkey -n 0 -k /mnt/pendrive/keys/`hostname` /dev/ad0s1e
+# geli setkey -n 0 -k /mnt/pendrive/keys/`hostname` /dev/ada0s1e
(allow the user to enter his passphrase)
Enter new passphrase:
Reenter new passphrase:
@@ -852,9 +852,9 @@ Reenter new passphrase:
.Pp
Encrypted swap partition setup:
.Bd -literal -offset indent
-# dd if=/dev/random of=/dev/ad0s1b bs=1m
-# geli onetime -d -e 3des ad0s1b
-# swapon /dev/ad0s1b.eli
+# dd if=/dev/random of=/dev/ada0s1b bs=1m
+# geli onetime -d -e 3des ada0s1b
+# swapon /dev/ada0s1b.eli
.Ed
.Pp
The example below shows how to configure two providers which will be attached
diff --git a/sbin/geom/class/shsec/gshsec.8 b/sbin/geom/class/shsec/gshsec.8
index 67dff5d..f72c31c 100644
--- a/sbin/geom/class/shsec/gshsec.8
+++ b/sbin/geom/class/shsec/gshsec.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 8, 2005
+.Dd October 1, 2013
.Dt GSHSEC 8
.Os
.Sh NAME
@@ -108,7 +108,7 @@ Exit status is 0 on success, and 1 if the command fails.
The following example shows how to create a shared secret device.
The secret will be split between a slice on a local disk and a USB Pen drive.
.Bd -literal -offset indent
-gshsec label -v secret /dev/ad0s1 /dev/da0
+gshsec label -v secret /dev/ada0s1 /dev/da0
newfs /dev/shsec/secret
.Ed
.Pp
diff --git a/sbin/geom/class/virstor/gvirstor.8 b/sbin/geom/class/virstor/gvirstor.8
index 99eff52..0273cb4 100644
--- a/sbin/geom/class/virstor/gvirstor.8
+++ b/sbin/geom/class/virstor/gvirstor.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 3, 2012
+.Dd October 1, 2013
.Dt GVIRSTOR 8
.Os
.Sh NAME
@@ -161,7 +161,7 @@ size
.Pq 4 MiB ,
with two physical devices for backing storage.
.Bd -literal -offset indent
-.No gvirstor label -v Ar mydata Ar /dev/ad4 Ar /dev/ad6
+.No gvirstor label -v Ar mydata Ar /dev/ada4 Ar /dev/ada6
.No newfs Ar /dev/virstor/mydata
.Ed
.Pp
@@ -170,11 +170,11 @@ From now on, the virtual device will be available via the
device entry.
To add a new physical device / component to an active virstor device:
.Bd -literal -offset indent
-.No gvirstor add Ar mydata Ar ad8
+.No gvirstor add Ar mydata Ar ada8
.Ed
.Pp
This will add physical storage of
-.Ar ad8
+.Ar ada8
to
.Pa /dev/virstor/mydata
device.
diff --git a/sbin/gvinum/gvinum.8 b/sbin/gvinum/gvinum.8
index 5d36276..d1d10d7 100644
--- a/sbin/gvinum/gvinum.8
+++ b/sbin/gvinum/gvinum.8
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 10, 2009
+.Dd October 1, 2013
.Dt GVINUM 8
.Os
.Sh NAME
@@ -279,27 +279,27 @@ directory with device nodes for
objects
.El
.Sh EXAMPLES
-To create a mirror on disks /dev/ad1 and /dev/ad2, create a filesystem, mount,
-unmount and then stop
+To create a mirror on disks /dev/ada1 and /dev/ada2, create a filesystem,
+mount, unmount and then stop
.Ic gvinum :
.Pp
-.Dl "gvinum mirror /dev/ad1 /dev/ad2"
+.Dl "gvinum mirror /dev/ada1 /dev/ada2"
.Dl "newfs /dev/gvinum/gvinumvolume0"
.Dl "mount /dev/gvinum/gvinumvolume0 /mnt"
.Dl "..."
.Dl "unmount /mnt"
.Dl "gvinum stop"
.Pp
-To create a striped mirror on disks /dev/ad1 /dev/ad2 /dev/ad3 and /dev/ad4
-named "data" and create a filesystem:
+To create a striped mirror on disks /dev/ada1 /dev/ada2 /dev/ada3 and
+/dev/ada4 named "data" and create a filesystem:
.Pp
-.Dl "gvinum mirror -s -n data /dev/ad1 /dev/ad2 /dev/ad3 /dev/ad4"
+.Dl "gvinum mirror -s -n data /dev/ada1 /dev/ada2 /dev/ada3 /dev/ada4"
.Dl "newfs /dev/gvinum/data"
.Pp
-To create a raid5 array on disks /dev/ad1 /dev/ad2 and /dev/ad3, with stripesize
-493k you can use the raid5 command:
+To create a raid5 array on disks /dev/ada1 /dev/ada2 and /dev/ada3,
+with stripesize 493k you can use the raid5 command:
.Pp
-.Dl "gvinum raid5 -s 493k /dev/ad1 /dev/ad2 /dev/ad3"
+.Dl "gvinum raid5 -s 493k /dev/ada1 /dev/ada2 /dev/ada3"
.Pp
Then the volume will be created automatically.
Afterwards, you have to initialize the volume:
@@ -313,9 +313,9 @@ The list command will give you information about its progress.
Imagine that one of the drives fails, and the output of 'printconfig' looks
something like this:
.Pp
-.Dl "drive gvinumdrive1 device /dev/ad2"
+.Dl "drive gvinumdrive1 device /dev/ada2"
.Dl "drive gvinumdrive2 device /dev/???"
-.Dl "drive gvinumdrive0 device /dev/ad1"
+.Dl "drive gvinumdrive0 device /dev/ada1"
.Dl "volume myraid5vol"
.Dl "plex name myraid5vol.p0 org raid5 986s vol myraid5vol"
.Dl "sd name myraid5vol.p0.s2 drive gvinumdrive2 len 32538s driveoffset 265s"
@@ -327,7 +327,7 @@ something like this:
.Pp
Create a new drive with this configuration:
.Pp
-.Dl "drive gdrive4 device /dev/ad4"
+.Dl "drive gdrive4 device /dev/ada4"
.Pp
Then move the stale subdisk to the new drive:
.Pp
@@ -344,7 +344,7 @@ might be delayed.
Given the configuration as in the previous example, growing a RAID-5 or STRIPED
array is accomplished by using the grow command:
.Pp
-.Dl "gvinum grow myraid5vol.p0 /dev/ad4"
+.Dl "gvinum grow myraid5vol.p0 /dev/ada4"
.Pp
If everything went ok, the plex state should now be set to growable.
You can then start the growing with the
diff --git a/sbin/hastd/hast.h b/sbin/hastd/hast.h
index 381e195..65c24f8 100644
--- a/sbin/hastd/hast.h
+++ b/sbin/hastd/hast.h
@@ -226,8 +226,10 @@ struct hast_resource {
/* Activemap structure. */
struct activemap *hr_amp;
- /* Locked used to synchronize access to hr_amp. */
+ /* Lock used to synchronize access to hr_amp. */
pthread_mutex_t hr_amp_lock;
+ /* Lock used to synchronize access to hr_amp diskmap. */
+ pthread_mutex_t hr_amp_diskmap_lock;
/* Number of BIO_READ requests. */
uint64_t hr_stat_read;
diff --git a/sbin/hastd/primary.c b/sbin/hastd/primary.c
index 92d1d9e..09ae17b 100644
--- a/sbin/hastd/primary.c
+++ b/sbin/hastd/primary.c
@@ -172,7 +172,7 @@ static pthread_mutex_t metadata_lock;
hio_next[(ncomp)]); \
mtx_unlock(&hio_##name##_list_lock[ncomp]); \
if (_wakeup) \
- cv_signal(&hio_##name##_list_cond[(ncomp)]); \
+ cv_broadcast(&hio_##name##_list_cond[(ncomp)]); \
} while (0)
#define QUEUE_INSERT2(hio, name) do { \
bool _wakeup; \
@@ -182,7 +182,7 @@ static pthread_mutex_t metadata_lock;
TAILQ_INSERT_TAIL(&hio_##name##_list, (hio), hio_##name##_next);\
mtx_unlock(&hio_##name##_list_lock); \
if (_wakeup) \
- cv_signal(&hio_##name##_list_cond); \
+ cv_broadcast(&hio_##name##_list_cond); \
} while (0)
#define QUEUE_TAKE1(hio, name, ncomp, timeout) do { \
bool _last; \
@@ -291,22 +291,28 @@ primary_exitx(int exitcode, const char *fmt, ...)
exit(exitcode);
}
+/* Expects res->hr_amp locked, returns unlocked. */
static int
hast_activemap_flush(struct hast_resource *res)
{
const unsigned char *buf;
size_t size;
+ int ret;
+ mtx_lock(&res->hr_amp_diskmap_lock);
buf = activemap_bitmap(res->hr_amp, &size);
+ mtx_unlock(&res->hr_amp_lock);
PJDLOG_ASSERT(buf != NULL);
PJDLOG_ASSERT((size % res->hr_local_sectorsize) == 0);
+ ret = 0;
if (pwrite(res->hr_localfd, buf, size, METADATA_SIZE) !=
(ssize_t)size) {
pjdlog_errno(LOG_ERR, "Unable to flush activemap to disk");
res->hr_stat_activemap_write_error++;
- return (-1);
+ ret = -1;
}
- if (res->hr_metaflush == 1 && g_flush(res->hr_localfd) == -1) {
+ if (ret == 0 && res->hr_metaflush == 1 &&
+ g_flush(res->hr_localfd) == -1) {
if (errno == EOPNOTSUPP) {
pjdlog_warning("The %s provider doesn't support flushing write cache. Disabling it.",
res->hr_localpath);
@@ -315,10 +321,11 @@ hast_activemap_flush(struct hast_resource *res)
pjdlog_errno(LOG_ERR,
"Unable to flush disk cache on activemap update");
res->hr_stat_activemap_flush_error++;
- return (-1);
+ ret = -1;
}
}
- return (0);
+ mtx_unlock(&res->hr_amp_diskmap_lock);
+ return (ret);
}
static bool
@@ -783,6 +790,7 @@ init_remote(struct hast_resource *res, struct proto_conn **inp,
* Now that we merged bitmaps from both nodes, flush it to the
* disk before we start to synchronize.
*/
+ mtx_lock(&res->hr_amp_lock);
(void)hast_activemap_flush(res);
}
nv_free(nvin);
@@ -1288,8 +1296,9 @@ ggate_recv_thread(void *arg)
ggio->gctl_offset, ggio->gctl_length)) {
res->hr_stat_activemap_update++;
(void)hast_activemap_flush(res);
+ } else {
+ mtx_unlock(&res->hr_amp_lock);
}
- mtx_unlock(&res->hr_amp_lock);
break;
case BIO_DELETE:
res->hr_stat_delete++;
@@ -1650,8 +1659,9 @@ done_queue:
if (activemap_need_sync(res->hr_amp, ggio->gctl_offset,
ggio->gctl_length)) {
(void)hast_activemap_flush(res);
+ } else {
+ mtx_unlock(&res->hr_amp_lock);
}
- mtx_unlock(&res->hr_amp_lock);
if (hio->hio_replication == HAST_REPLICATION_MEMSYNC)
(void)refcnt_release(&hio->hio_countdown);
}
@@ -1918,8 +1928,9 @@ ggate_send_thread(void *arg)
ggio->gctl_offset, ggio->gctl_length)) {
res->hr_stat_activemap_update++;
(void)hast_activemap_flush(res);
+ } else {
+ mtx_unlock(&res->hr_amp_lock);
}
- mtx_unlock(&res->hr_amp_lock);
}
if (ggio->gctl_cmd == BIO_WRITE) {
/*
@@ -2015,8 +2026,11 @@ sync_thread(void *arg __unused)
*/
if (activemap_extent_complete(res->hr_amp, syncext))
(void)hast_activemap_flush(res);
+ else
+ mtx_unlock(&res->hr_amp_lock);
+ } else {
+ mtx_unlock(&res->hr_amp_lock);
}
- mtx_unlock(&res->hr_amp_lock);
if (dorewind) {
dorewind = false;
if (offset == -1)
diff --git a/sbin/hastd/secondary.c b/sbin/hastd/secondary.c
index c0c67c6..067c5d9 100644
--- a/sbin/hastd/secondary.c
+++ b/sbin/hastd/secondary.c
@@ -85,14 +85,13 @@ static TAILQ_HEAD(, hio) hio_free_list;
static pthread_mutex_t hio_free_list_lock;
static pthread_cond_t hio_free_list_cond;
/*
- * Disk thread (the one that do I/O requests) takes requests from this list.
+ * Disk thread (the one that does I/O requests) takes requests from this list.
*/
static TAILQ_HEAD(, hio) hio_disk_list;
static pthread_mutex_t hio_disk_list_lock;
static pthread_cond_t hio_disk_list_cond;
/*
- * There is one recv list for every component, although local components don't
- * use recv lists as local requests are done synchronously.
+ * Thread that sends requests back to primary takes requests from this list.
*/
static TAILQ_HEAD(, hio) hio_send_list;
static pthread_mutex_t hio_send_list_lock;
@@ -115,7 +114,7 @@ static void *send_thread(void *arg);
TAILQ_INSERT_TAIL(&hio_##name##_list, (hio), hio_next); \
mtx_unlock(&hio_##name##_list_lock); \
if (_wakeup) \
- cv_signal(&hio_##name##_list_cond); \
+ cv_broadcast(&hio_##name##_list_cond); \
} while (0)
#define QUEUE_TAKE(name, hio) do { \
mtx_lock(&hio_##name##_list_lock); \
diff --git a/sbin/iscontrol/iscontrol.8 b/sbin/iscontrol/iscontrol.8
index f683815..860b35a 100644
--- a/sbin/iscontrol/iscontrol.8
+++ b/sbin/iscontrol/iscontrol.8
@@ -112,6 +112,7 @@ whatever options are specified, and start an iscsi-session.
.Xr iscsi_initiator 4 ,
.Xr sa 4 ,
.Xr iscsi.conf 5 ,
+.Xr iscsictl 8 ,
.Xr camcontrol 8
.Sh STANDARDS
RFC 3720
diff --git a/sbin/iscontrol/iscsi.conf.5 b/sbin/iscontrol/iscsi.conf.5
index e6a776d..f87fef6 100644
--- a/sbin/iscontrol/iscsi.conf.5
+++ b/sbin/iscontrol/iscsi.conf.5
@@ -24,18 +24,20 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 5, 2007
+.Dd October 10, 2013
.Dt ISCSI.CONF 5
.Os
.Sh NAME
.Nm iscsi.conf
-.Nd key options to be negotiated in an iSCSI session
+.Nd iSCSI initiator configuration file
.Sh DESCRIPTION
The file
.Nm ,
-is read by the
+is used by the
+.Xr iscsictl 8
+and
.Xr iscontrol 8
-program.
+utilities.
It contains declarations and parameter/key-options.
The syntax is very simple,
.D1 Li variable = value;
@@ -69,9 +71,6 @@ Default is none.
.It Cm DataDigest
same as for HeaderDigest, but on the data part of the iSCSI PDU.
(not yet tested)
-.It Cm MaxConnections
-is the number of simultaneous connections per session,
-currently only 1.
.It Cm TargetName
is the name by which the target is known, not to be confused with
target address, either obtained via the target administrator, or
@@ -81,8 +80,6 @@ from a
if not specified, defaults to
.Sy iqn.2005-01.il.ac.huji.cs:
.Aq hostname .
-.It Cm TargetAlias / InitiatorAlias
-not implemented.
.It Cm TargetAddress
is of the form
.Sy domainname[:port][,portal-group-tag]
@@ -93,35 +90,16 @@ dotted-decimal IPv4 address, or a bracketed IPv6 address as specified
in [RFC2732].
.Ed
Note: portal-group-tag is unused at the moment.
-.It Cm TargetPortalGroupTag
-.Em not implemented yet.
-.It Cm InitialR2T
-.Em not implemented yet.
-.It Cm ImmediateData
.Em not implemented yet.
.It Cm MaxRecvDataSegmentLength
the maximum data segment length in
bytes it can receive in an iSCSI PDU, default is 8192.
-.It Cm MaxBurstLength
-.Em not implemented yet.
-.It Cm FirstBurstLength
-.Em not implemented yet.
-.It Cm DefaultTime2Wait
-.Em not implemented yet.
-.It Cm DefaultTime2Retain
-.Em not implemented yet.
.It Cm MaxOutstandingR2T
is used to calculate/negotiate the
.Em tag opening ,
can be overridden by the
.Sy tag
option.
-.It Cm DataPDUInOrder
-.Em not implemented yet.
-.It Cm DataSequenceInOrder
-.Em not implemented yet.
-.It Cm ErrorRecoveryLevel
-Only level 0 is supported.
.It Cm SessionType
either Discovery or Normal, default is Normal, see the
.Fl d
@@ -196,11 +174,9 @@ chaptest {
tags = 256
}
.Ed
-.Sh ERRORS
-The parsing is very primitive, so do not expect - at the moment - any
-error messages.
.Sh SEE ALSO
.Xr iscsi_initiator 4 ,
+.Xr iscsictl 8 ,
.Xr iscontrol 8
.Sh STANDARDS
ISCSI RFC 3720
diff --git a/sbin/mount_msdosfs/mount_msdosfs.8 b/sbin/mount_msdosfs/mount_msdosfs.8
index 3dac013..e7bc764 100644
--- a/sbin/mount_msdosfs/mount_msdosfs.8
+++ b/sbin/mount_msdosfs/mount_msdosfs.8
@@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 23, 2008
+.Dd October 1, 2013
.Dt MOUNT_MSDOSFS 8
.Os
.Sh NAME
@@ -182,14 +182,14 @@ Specify text file name with conversion table:
.El
.Sh EXAMPLES
To mount a Russian MS-DOS file system located in
-.Pa /dev/ad1s1 :
+.Pa /dev/ada1s1 :
.Pp
-.Dl "mount_msdosfs -L ru_RU.KOI8-R -D CP866 /dev/ad1s1 /mnt"
+.Dl "mount_msdosfs -L ru_RU.KOI8-R -D CP866 /dev/ada1s1 /mnt"
.Pp
To mount a Japanese MS-DOS file system located in
-.Pa /dev/ad1s1 :
+.Pa /dev/ada1s1 :
.Pp
-.Dl "mount_msdosfs -L ja_JP.eucJP -D CP932 /dev/ad1s1 /mnt"
+.Dl "mount_msdosfs -L ja_JP.eucJP -D CP932 /dev/ada1s1 /mnt"
.Sh SEE ALSO
.Xr mount 2 ,
.Xr unmount 2 ,
diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8
index 51cc833..6764adc 100644
--- a/sbin/newfs/newfs.8
+++ b/sbin/newfs/newfs.8
@@ -28,7 +28,7 @@
.\" @(#)newfs.8 8.6 (Berkeley) 5/3/95
.\" $FreeBSD$
.\"
-.Dd June 22, 2011
+.Dd October 1, 2013
.Dt NEWFS 8
.Os
.Sh NAME
@@ -285,10 +285,10 @@ to find the alternate superblocks if the standard superblock is lost.
The size of a sector in bytes (almost never anything but 512).
.El
.Sh EXAMPLES
-.Dl newfs /dev/ad3s1a
+.Dl newfs /dev/ada3s1a
.Pp
Creates a new ufs file system on
-.Pa ad3s1a .
+.Pa ada3s1a .
The
.Nm
utility will use a block size of 32768 bytes, a fragment size of 4096 bytes
diff --git a/sbin/newfs_msdos/newfs_msdos.8 b/sbin/newfs_msdos/newfs_msdos.8
index ce51113..1627f2d 100644
--- a/sbin/newfs_msdos/newfs_msdos.8
+++ b/sbin/newfs_msdos/newfs_msdos.8
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 25, 2010
+.Dd October 1, 2013
.Dt NEWFS_MSDOS 8
.Os
.Sh NAME
@@ -209,9 +209,9 @@ The maximum file size is 4GB, even if the file system itself is bigger.
Exit status is 0 on success and 1 on error.
.Sh EXAMPLES
Create a file system, using default parameters, on
-.Pa /dev/ad0s1 :
+.Pa /dev/ada0s1 :
.Bd -literal -offset indent
-newfs_msdos /dev/ad0s1
+newfs_msdos /dev/ada0s1
.Ed
.Pp
Create a standard 1.44M file system, with volume label
diff --git a/sbin/newfs_nandfs/newfs_nandfs.8 b/sbin/newfs_nandfs/newfs_nandfs.8
index c6a6f1b..6997430 100644
--- a/sbin/newfs_nandfs/newfs_nandfs.8
+++ b/sbin/newfs_nandfs/newfs_nandfs.8
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 11, 2009
+.Dd October 1, 2013
.Dt NEWFS_NANDFS 8
.Os
.Sh NAME
@@ -58,9 +58,9 @@ Percentage of reserved blocks (5 if not specified).
Exit status is 0 on success and 1 on error.
.Sh EXAMPLES
Create a file system, using default parameters, on
-.Pa /dev/ad0s1 :
+.Pa /dev/ada0s1 :
.Bd -literal -offset indent
-newfs_nandfs /dev/ad0s1
+newfs_nandfs /dev/ada0s1
.Ed
.Sh SEE ALSO
.Xr disktab 5 ,
diff --git a/sbin/nvmecontrol/perftest.c b/sbin/nvmecontrol/perftest.c
index a7339bf..15e4975 100644
--- a/sbin/nvmecontrol/perftest.c
+++ b/sbin/nvmecontrol/perftest.c
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
#include <ctype.h>
#include <err.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
@@ -45,7 +46,8 @@ __FBSDID("$FreeBSD$");
static void
print_perftest(struct nvme_io_test *io_test, bool perthread)
{
- uint32_t i, io_completed = 0, iops, mbps;
+ uint64_t io_completed = 0, iops, mbps;
+ uint32_t i;
for (i = 0; i < io_test->num_threads; i++)
io_completed += io_test->io_completed[i];
@@ -53,15 +55,15 @@ print_perftest(struct nvme_io_test *io_test, bool perthread)
iops = io_completed/io_test->time;
mbps = iops * io_test->size / (1024*1024);
- printf("Threads: %2d Size: %6d %5s Time: %3d IO/s: %7d MB/s: %4d\n",
+ printf("Threads: %2d Size: %6d %5s Time: %3d IO/s: %7ju MB/s: %4ju\n",
io_test->num_threads, io_test->size,
io_test->opc == NVME_OPC_READ ? "READ" : "WRITE",
- io_test->time, iops, mbps);
+ io_test->time, (uintmax_t)iops, (uintmax_t)mbps);
if (perthread)
for (i = 0; i < io_test->num_threads; i++)
- printf("\t%3d: %8d IO/s\n", i,
- io_test->io_completed[i]/io_test->time);
+ printf("\t%3d: %8ju IO/s\n", i,
+ (uintmax_t)io_test->io_completed[i]/io_test->time);
exit(1);
}
diff --git a/sbin/recoverdisk/recoverdisk.1 b/sbin/recoverdisk/recoverdisk.1
index 1661ab8..b3924c5 100644
--- a/sbin/recoverdisk/recoverdisk.1
+++ b/sbin/recoverdisk/recoverdisk.1
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 5, 2012
+.Dd October 1, 2013
.Dt RECOVERDISK 1
.Os
.Sh NAME
@@ -104,11 +104,11 @@ Percent complete.
.El
.Sh EXAMPLES
.Bd -literal
-# recover data from failing hard drive ad3
-recoverdisk /dev/ad3 /data/disk.img
+# recover data from failing hard drive ada3
+recoverdisk /dev/ada3 /data/disk.img
# clone a hard disk
-recoverdisk /dev/ad3 /dev/ad4
+recoverdisk /dev/ada3 /dev/ada4
# read an ISO image from a CD-ROM
recoverdisk /dev/cd0 /data/cd.iso
@@ -120,7 +120,7 @@ recoverdisk -r worklist -w worklist /dev/cd0 /data/cd.iso
recoverdisk /cdrom/file.avi file.avi
# If the disk hangs the system on read-errors try:
-recoverdisk -b 0 /dev/ad3 /somewhere
+recoverdisk -b 0 /dev/ada3 /somewhere
.Ed
.Sh SEE ALSO
diff --git a/sbin/route/route.c b/sbin/route/route.c
index e575c71..6c2bbe2 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -928,6 +928,11 @@ newroute(int argc, char **argv)
}
}
+ if (so[RTAX_DST].ss_len == 0) {
+ warnx("destination parameter required");
+ usage(NULL);
+ }
+
if (nrflags & F_FORCEHOST) {
nrflags |= F_ISHOST;
#ifdef INET6
OpenPOWER on IntegriCloud