From a992abf0413f4cc428d4368e1d82d65f5b3d6397 Mon Sep 17 00:00:00 2001 From: trasz Date: Sat, 14 Sep 2013 15:29:06 +0000 Subject: Bring in the new iSCSI target and initiator. Reviewed by: ken (parts) Approved by: re (delphij) Sponsored by: FreeBSD Foundation --- sbin/iscontrol/iscontrol.8 | 1 + sbin/iscontrol/iscsi.conf.5 | 1 + 2 files changed, 2 insertions(+) (limited to 'sbin') 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..0a72d51 100644 --- a/sbin/iscontrol/iscsi.conf.5 +++ b/sbin/iscontrol/iscsi.conf.5 @@ -201,6 +201,7 @@ 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 -- cgit v1.1 From 2604d523b6631d11bcc72412ec3d3c2fd27dffc9 Mon Sep 17 00:00:00 2001 From: trociny Date: Thu, 19 Sep 2013 20:15:24 +0000 Subject: Use cv_broadcast() instead of cv_signal() when waking up threads waiting on an empty queue as the queue may have several consumers. Before the fix the following scenario was possible: 2 threads are waiting on empty queue, 2 threads are inserting simultaneously. The first inserting thread detects that the queue is empty and is going to send the signal, but before it sends the second thread inserts too. When the first sends the signal only one of the waiting threads receive it while the other one may wait forever. The scenario above is is believed to be the cause of the observed cases, when ggate_recv_thread() was getting stuck on taking free request, while the free queue was not empty. Reviewed by: pjd Tested by: Yamagi Burmeister yamagi.org Approved by: re (marius) MFC after: 2 weeks --- sbin/hastd/primary.c | 4 ++-- sbin/hastd/secondary.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sbin') diff --git a/sbin/hastd/primary.c b/sbin/hastd/primary.c index 92d1d9e..5758f41 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; \ diff --git a/sbin/hastd/secondary.c b/sbin/hastd/secondary.c index c0c67c6..f766003 100644 --- a/sbin/hastd/secondary.c +++ b/sbin/hastd/secondary.c @@ -115,7 +115,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); \ -- cgit v1.1 From 5ea0541321e9ba54c56acd578c1c2fd41c7d0b1d Mon Sep 17 00:00:00 2001 From: trociny Date: Thu, 19 Sep 2013 20:19:08 +0000 Subject: When updating the map of dirty extents, most recently used extents are kept dirty to reduce the number of on-disk metadata updates. The sequence of operations is: 1) acquire the activemap lock; 2) update in-memory map; 3) if the list of keepdirty extents is changed, update on-disk metadata; 4) release the lock. On-disk updates are not frequent in comparison with in-memory updates, while require much more time. So situations are possible when one thread is updating on-disk metadata and another one is waiting for the activemap lock just to update the in-memory map. Improve this by introducing additional, on-disk map lock: when in-memory map is updated and it is detected that the on-disk map needs update too, the on-disk map lock is acquired and the on-memory lock is released before flushing the map. Reported by: Yamagi Burmeister yamagi.org Tested by: Yamagi Burmeister yamagi.org Reviewed by: pjd Approved by: re (marius) MFC after: 2 weeks --- sbin/hastd/hast.h | 4 +++- sbin/hastd/primary.c | 30 ++++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 9 deletions(-) (limited to 'sbin') 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 5758f41..09ae17b 100644 --- a/sbin/hastd/primary.c +++ b/sbin/hastd/primary.c @@ -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) -- cgit v1.1 From 5db794f1d060b74774d6ca54a81edb5987da2602 Mon Sep 17 00:00:00 2001 From: trociny Date: Thu, 19 Sep 2013 20:20:59 +0000 Subject: Fix comments. Approved by: re (marius) MFC after: 3 days --- sbin/hastd/secondary.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sbin') diff --git a/sbin/hastd/secondary.c b/sbin/hastd/secondary.c index f766003..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; -- cgit v1.1 From 2a7d79cb157699276bc9f3528b6113b83849c881 Mon Sep 17 00:00:00 2001 From: hiren Date: Fri, 20 Sep 2013 15:57:50 +0000 Subject: Fix a range check and a display string. Reviewed by: loos Approved by: sbruno (mentor, implicit) Approved by: re (glebius) --- sbin/etherswitchcfg/etherswitchcfg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sbin') 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) -- cgit v1.1 From 0e1e730ce790f1bb4ce55cde187809b020a3313b Mon Sep 17 00:00:00 2001 From: hiren Date: Fri, 20 Sep 2013 19:25:01 +0000 Subject: Improve grammar and readability. Reviewed by: sbruno, loos Approved by: re (gjb) --- sbin/etherswitchcfg/etherswitchcfg.8 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sbin') 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 -- cgit v1.1 From 3f9b2596429813d2d1d8d1b5805610f7d711624c Mon Sep 17 00:00:00 2001 From: pluknet Date: Tue, 1 Oct 2013 18:41:53 +0000 Subject: Sweep man pages replacing ad -> ada. Approved by: re (blackend) MFC after: 1 week X-MFC note: stable/9 only --- sbin/bsdlabel/bsdlabel.8 | 6 +++--- sbin/ccdconfig/ccdconfig.8 | 4 ++-- sbin/fdisk/fdisk.8 | 4 ++-- sbin/gbde/gbde.8 | 16 ++++++++-------- sbin/geom/class/eli/geli.8 | 14 +++++++------- sbin/geom/class/shsec/gshsec.8 | 4 ++-- sbin/geom/class/virstor/gvirstor.8 | 8 ++++---- sbin/gvinum/gvinum.8 | 28 ++++++++++++++-------------- sbin/mount_msdosfs/mount_msdosfs.8 | 10 +++++----- sbin/newfs/newfs.8 | 6 +++--- sbin/newfs_msdos/newfs_msdos.8 | 6 +++--- sbin/newfs_nandfs/newfs_nandfs.8 | 6 +++--- sbin/recoverdisk/recoverdisk.1 | 10 +++++----- 13 files changed, 61 insertions(+), 61 deletions(-) (limited to 'sbin') 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/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/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/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/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 -- cgit v1.1 From 082d19dd6e6d8f671df3bc5bf7391273de3f1a92 Mon Sep 17 00:00:00 2001 From: emaste Date: Mon, 7 Oct 2013 16:45:16 +0000 Subject: Fix resource leaks Found by: Coverity Scan, CID 1016673, 1007118 Approved by: re --- sbin/camcontrol/fwdownload.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sbin') 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. */ -- cgit v1.1 From 41bda5b66a85fa1d81383cb9d4cea33a31a88a61 Mon Sep 17 00:00:00 2001 From: markj Date: Tue, 8 Oct 2013 04:16:22 +0000 Subject: Fix an inverted check for the master user in "camcontrol security -U". PR: bin/182703 Submitted by: Scott Burns Approved by: re (gjb) MFC after: 3 days --- sbin/camcontrol/camcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sbin') 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 { -- cgit v1.1 From f1b97b5667257dbd0ec9f0ea453e41233f1cc9c7 Mon Sep 17 00:00:00 2001 From: glebius Date: Tue, 8 Oct 2013 08:16:17 +0000 Subject: When destination parameter is missing, exit with a clear synopsis, instead of writing to kernel and printing EINVAL description. PR: bin/181532 Submitted by: Kurt Jaeger Approved by: re (hrs) --- sbin/route/route.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sbin') 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 -- cgit v1.1 From bb66cfd2ae8464ce44d16ab33621589703029906 Mon Sep 17 00:00:00 2001 From: jimharris Date: Tue, 8 Oct 2013 15:47:22 +0000 Subject: Extend some 32-bit fields and variables to 64-bit to prevent overflow when calculating stats in nvmecontrol perftest. Sponsored by: Intel Reported by: Joe Golio Reviewed by: carl Approved by: re (hrs) MFC after: 1 week --- sbin/nvmecontrol/perftest.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'sbin') 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 #include #include +#include #include #include #include @@ -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); } -- cgit v1.1 From 64cccdad5e235a4294ffac6ee97453182831a9a4 Mon Sep 17 00:00:00 2001 From: trasz Date: Thu, 10 Oct 2013 11:28:20 +0000 Subject: Remove unimplemented options from iscsi.conf(5) manual page, mention that it's being used by both initiators, and change the title to make it more easily searchable. Approved by: re (glebius) Sponsored by: FreeBSD Foundation --- sbin/iscontrol/iscsi.conf.5 | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) (limited to 'sbin') diff --git a/sbin/iscontrol/iscsi.conf.5 b/sbin/iscontrol/iscsi.conf.5 index 0a72d51..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,9 +174,6 @@ 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 , -- cgit v1.1