summaryrefslogtreecommitdiffstats
path: root/sbin
Commit message (Collapse)AuthorAgeFilesLines
* MFH (r256768): don't report an error for no-op add / removedes2014-02-271-2/+2
|
* MFC 261517,261520:jhb2014-02-181-3/+0
| | | | | Convert the license on files where I am the sole copyright holder to 2 clause BSD licenses.
* Refer newfs and growfs users to fsck_ffs instead ofbrueffer2014-02-162-2/+2
| | | | | | | fsck, the latter does not accept the referred to "-b" flag. PR: 82720 Submitted by: David D.W. Downey
* MFC: r261566brueffer2014-02-132-2/+2
| | | | | | | | Use CAP_EVENT instead of the deprecated CAP_POLL_EVENT. PR: 185382 (based on) Submitted by: Loganaden Velvindron Reviewed by: pjd
* MFC: r261500brueffer2014-02-111-4/+36
| | | | | | Add a license (1) and do some cleanup. Approved by: Stefan Bethke (original author, by private mail) (1)
* MFC: r261496brueffer2014-02-111-3/+3
| | | | | | | | Unbreak mount_udf by passing the correct iovec length into nmount(). This has been broken since r247861. PR: bin/186193 Submitted by: Arnot Belohlavek
* MFH: r260483, r260484, r260594, r260595, r260596, r260597bapt2014-01-201-1/+16
| | | | | | | | Improve error message shown to the user when trying to load a module that is already loaded or compiled withing the kernel Point the user to dmesg(1) to get informations about why loading a module did fail instead of printing the cryptic "Exec format error" Update the BUGS section of kld(4) according the recent changes in kldload(8)
* MFC 259339asomers2014-01-101-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | sbin/devd/devd.cc Increase the size of devd's client socket's send buffer from the default (8k) to 128k. This prevents clients from getting POLLHUPped during event storms. For example, during zpool creation, the kernel emits a resource.fs.zfs.statechange event for every vdev in the pool. A 128k buffer is large enough to hold the statechange events for a pool with nearly 800 drives. MFC 259362 sbin/devd/devd.cc Promoting the SIGINFO handler's log message from LOG_INFO to LOG_NOTICE, and promoting the "Processing event ..." message from LOG_DEBUG to LOG_INFO. Setting the logfile to LOG_NOTICE with this change will have the same result as setting it to LOG_INFO without this change. Setting it to LOG_INFO with this change will include the useful "Processing event ..." messages that were previously at LOG_DEBUG, without including useless messages like "Pushing table". The intent of this change is that one can log "Processing event ..." without logging "Pushing table" and related messages that are sent for every event. The number of lines actually logged is reduced by about 75% by making this change and setting syslog to LOG_INFO vs setting syslog to LOG_DEBUG. etc/syslog.conf Changing the recommended loglevel to notice instead of info.
* MFC r259634:ae2014-01-102-1/+20
| | | | | | | | | | | | | | | | | | Prevent users from deactivating the last component of a mirror. MFC r259929: Add an ability to stop gmirror and clear its metadata in one command. This fixes the problem, when gmirror starts again just after stop. The problem occurs when gmirror's component has geom label with equal size. E.g. gpt and gptid have the same size as partition, diskid has the same size as entire disk. When gmirror's geom has been destroyed, glabel creates its providers and this initiate retaste. Now "gmirror destroy" command is available. It destroys geom and also erases gmirror's metadata. PR: 184985
* MFC r258357:ae2014-01-102-1/+118
| | | | | | | Add "resize" verb to gmirror(8) and such functionality to geom_mirror(4). Now it is easy to expand the size of the mirror when all its components are replaced. Also add g_resize method to geom_mirror class. It will write updated metadata to new last sector, when parent provider is resized.
* MFC r258659:trasz2014-01-021-2/+2
| | | | | | Fix warnings to not append "No error: 0". Sponsored by: The FreeBSD Foundation
* MFC r259502:trasz2014-01-021-5/+4
| | | | | | Reword the part about mutual CHAP. Sponsored by: The FreeBSD Foundation
* MFC r260068, r260069, r260076scottl2014-01-0212-109/+349
| | | | | | | | | | | | | | | | | | | | | | Add the -R option to allow fsck_ffs to restart itself when too many critical errors have been detected in a particular run. Clean up the global state variables so that a restart can happen correctly. Separate the global variables in fsck_ffs and fsdb to their own file. This fixes header sharing with fscd. Correctly initialize, static-ize, and remove global variables as needed in dir.c. This fixes a problem with lost+found directories that was causing a segfault. Correctly initialize, static-ize, and remove global variables as needed in suj.c. Initialize the suj globals before allocating the disk object, not after. Also ensure that 'preen' mode doesn't conflict with 'restart' mode Obtained from: Netflix
* MFC r260059, r260087:scottl2014-01-022-8/+31
| | | | | | | Add the '-b' flag to 'camcontrol devlist'. This prints only the existing buses and their parent sims, useful for creating a sim->bus->device map. Obtained from: Netflix
* MFC: r259089rmacklem2013-12-301-1/+14
| | | | | Document the noncontigwr NFS mount option. This is a content change.
* MFC r257155, r257582, r259191, r259192, r259193, r259194, r259195, r259196:trociny2013-12-289-150/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r257155: Make hastctl list command output current queue sizes. Reviewed by: pjd r257582 (pjd): Correct alignment. r259191: For memsync replication, hio_countdown is used not only as an indication when a request can be moved to done queue, but also for detecting the current state of memsync request. This approach has problems, e.g. leaking a request if memsynk ack from the secondary failed, or racy usage of write_complete, which should be called only once per write request, but for memsync can be entered by local_send_thread and ggate_send_thread simultaneously. So the following approach is implemented instead: 1) Use hio_countdown only for counting components we waiting to complete, i.e. initially it is always 2 for any replication mode. 2) To distinguish between "memsync ack" and "memsync fin" responses from the secondary, add and use hio_memsyncacked field. 3) write_complete() in component threads is called only before releasing hio_countdown (i.e. before the hio may be returned to the done queue). 4) Add and use hio_writecount refcounter to detect when write_complete() can be called in memsync case. Reported by: Pete French petefrench ingresso.co.uk Tested by: Pete French petefrench ingresso.co.uk r259192: Add some macros to make the code more readable (no functional chages). r259193: Fix compiler warnings. r259194: In remote_send_thread, if sending a request fails don't take the request back from the receive queue -- it might already be processed by remote_recv_thread, which lead to crashes like below: (primary) Unable to receive reply header: Connection reset by peer. (primary) Unable to send request (Connection reset by peer): WRITE(954662912, 131072). (primary) Disconnected from kopusha:7772. (primary) Increasing localcnt to 1. (primary) Assertion failed: (old > 0), function refcnt_release, file refcnt.h, line 62. Taking the request back was not necessary (it would properly be processed by the remote_recv_thread) and only complicated things. r259195: Send wakeup to threads waiting on empty queue before releasing the lock to decrease spurious wakeups. Submitted by: davidxu r259196: Check remote protocol version only for the first connection (when it is actually sent by the remote node). Otherwise it generated confusing "Negotiated protocol version 1" debug messages when processing the second connection.
* MFC r258469:pluknet2013-12-251-6/+4
| | | | | | | - Purge one more reference to ad(4)[1]. - NSWAPDEV limit has gone. Noticed by: Sergey V. Dyatko [1]
* MFC r259677: swapon: Fix buffer overflow when configuring swap on GBDE.jilles2013-12-241-1/+2
| | | | PR: bin/184950
* MFC 257006asomers2013-12-131-3/+31
| | | | | | | | | sbin/geom/class/part/geom_part.c Always validate the return of find_geomcfg(). It could be NULL, for example when the geom is withering. Approved by: ken (mentor) Sponsored by: Spectra Logic Corporation
* MFC r256448, r257029;pfg2013-12-112-2/+2
| | | | | | | | | | | | | Make di_blocks unsigned in UFS1 as is the case already for UFS2. Most of the code between UFS1 and UFS2 is shared so this change is pretty safe. Not only this makes UFS1 and 2 consistent but it also matches what NetBSD and MacOS X have for some years now. UFS2: make di_extsize unsigned. di_extsize is the EA size and as such it should be unsigned. Adjust related types for consistency. Reviewed by: mckusick
* MFC r257345,257382,257388:nwhitehorn2013-12-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Implement extended LUN support. If PIM_EXTLUNS is set by a SIM, encode the upper 32-bits of the LUN, if possible, into the target_lun field as passed directly from the REPORT LUNs response. This allows extended LUN support to work for all LUNs with zeros in the lower 32-bits, which covers most addressing modes without breaking KBI. Behavior for drivers not setting PIM_EXTLUNS is unchanged. No user-facing interfaces are modified. Extended LUNs are stored with swizzled 16-bit word order so that, for devices implementing LUN addressing (like SCSI-2), the numerical representation of the LUN is identical with and without PIM_EXTLUNS. Thus setting PIM_EXTLUNS keeps most behavior, and user-facing LUN IDs, unchanged. This follows the strategy used in Solaris. A macro (CAM_EXTLUN_BYTE_SWIZZLE) is provided to transform a lun_id_t into a uint64_t ordered for the wire. This is the second part of work for full 64-bit extended LUN support and is designed to a bridge for stable/10 to the final 64-bit LUN code. The third and final part will involve widening lun_id_t to 64 bits and will not be MFCed. This third part will break the KBI but will keep the KPI unchanged so that all drivers that will care about this can be updated now and not require code changes between HEAD and stable/10. Reviewed by: scottl
* MFC r257531:jimharris2013-11-051-2/+0
| | | | | | | Do not exit with error status after printing data for perftest. Sponsored by: Intel Approved by: re (glebius)
* MFC r257154:trociny2013-10-311-1/+1
| | | | | | | | | | | | Merging local and remote bitmaps must be protected by hr_amp lock. This is believed to fix hastd crashes, which might occur during synchronization, triggered by the failed assertion: Assertion failed: (amp->am_memtab[ext] > 0), function activemap_write_complete, file activemap.c, line 351. Approved by: re (glebius)
* Merge r256824 from head:glebius2013-10-291-2/+2
| | | | | | | | | | | | | | | | Provide a working example line for an interface with 1 address running with CARP. Currently, we've got a problem that interface isn't IFF_UP at the time we assign it a redundant address, and the latter gets stuck in INIT state. Additional SIOCSIFFLAGS from ifconfig(8) kicks it to a working state. A proper fix is kernel side and appeared to be non-trivial, not to be checked in before 10.0-RELEASE. Submitted by: Ole Myhre <ole.myhre dataoppdrag.no> Approved by: re (kib)
* MFC r256317:mav2013-10-111-2/+2
| | | | | | | Fix mode page length calculation to remove last garbage line from the `camcontrol mode daX -l` output. Approved by: re (gjb)
* Remove unimplemented options from iscsi.conf(5) manual page, mentiontrasz2013-10-101-31/+6
| | | | | | | | 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
* Extend some 32-bit fields and variables to 64-bit to prevent overflowjimharris2013-10-081-5/+7
| | | | | | | | | | when calculating stats in nvmecontrol perftest. Sponsored by: Intel Reported by: Joe Golio <joseph.golio@emc.com> Reviewed by: carl Approved by: re (hrs) MFC after: 1 week
* When destination parameter is missing, exit with a clear synopsis,glebius2013-10-081-0/+5
| | | | | | | | instead of writing to kernel and printing EINVAL description. PR: bin/181532 Submitted by: Kurt Jaeger <fbsd-pr opsec.eu> Approved by: re (hrs)
* Fix an inverted check for the master user in "camcontrol security -U".markj2013-10-081-1/+1
| | | | | | | PR: bin/182703 Submitted by: Scott Burns <scott@bqinternet.com> Approved by: re (gjb) MFC after: 3 days
* Fix resource leaksemaste2013-10-071-0/+2
| | | | | Found by: Coverity Scan, CID 1016673, 1007118 Approved by: re
* Sweep man pages replacing ad -> ada.pluknet2013-10-0113-61/+61
| | | | | | Approved by: re (blackend) MFC after: 1 week X-MFC note: stable/9 only
* Improve grammar and readability.hiren2013-09-201-3/+3
| | | | | Reviewed by: sbruno, loos Approved by: re (gjb)
* Fix a range check and a display string.hiren2013-09-201-2/+2
| | | | | | Reviewed by: loos Approved by: sbruno (mentor, implicit) Approved by: re (glebius)
* Fix comments.trociny2013-09-191-3/+2
| | | | | Approved by: re (marius) MFC after: 3 days
* When updating the map of dirty extents, most recently used extents aretrociny2013-09-192-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use cv_broadcast() instead of cv_signal() when waking up threadstrociny2013-09-192-3/+3
| | | | | | | | | | | | | | | | | | | | 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
* Bring in the new iSCSI target and initiator.trasz2013-09-142-0/+2
| | | | | | Reviewed by: ken (parts) Approved by: re (delphij) Sponsored by: FreeBSD Foundation
* - Begin sentence on a new line.joel2013-09-071-14/+25
| | | | - Minor language fixes.
* newfs_msdos: fix inaccurate comments.pfg2013-09-071-2/+2
| | | | | | | | | | The fields from deMTime and deMDate in the DOS directory entry are actually the last-modified time/date. According to some online documentation these are the only timestamps available in FAT12/FAT16. MFC after: 3 days
* Update ipfilter 4.1.28 --> 5.1.2.cy2013-09-063-18/+42
| | | | | Approved by: glebius (mentor) BSD Licensed by: Darren Reed <darrenr@reed.wattle.id.au> (author)
* Bump .Dd after r255307 and r255310bryanv2013-09-061-1/+1
| | | | Requested by: joel
* Add firmware downloading support for Samsung drivesbryanv2013-09-062-0/+4
| | | | Tested on Samsung SM1625 SSDs.
* Add camcontrol support for the SCSI sanitize commandbryanv2013-09-062-1/+544
| | | | | Reviewed by: ken, mjacob (eariler version) Sponsored by: Netapp
* Style clean-ups.hrs2013-09-051-54/+48
| | | | Reviewed by: md5
* Enable "late" option when a file= option is specified in /etc/fstab.hrs2013-09-051-4/+11
| | | | | | The file= option requires rw mount where the backing store exists but it does not work because rc.d/swap runs before rc.d/fsck. Reported by: wblock
* Change the cap_rights_t type from uint64_t to a structure that we can extendpjd2013-09-053-19/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in the future in a backward compatible (API and ABI) way. The cap_rights_t represents capability rights. We used to use one bit to represent one right, but we are running out of spare bits. Currently the new structure provides place for 114 rights (so 50 more than the previous cap_rights_t), but it is possible to grow the structure to hold at least 285 rights, although we can make it even larger if 285 rights won't be enough. The structure definition looks like this: struct cap_rights { uint64_t cr_rights[CAP_RIGHTS_VERSION + 2]; }; The initial CAP_RIGHTS_VERSION is 0. The top two bits in the first element of the cr_rights[] array contain total number of elements in the array - 2. This means if those two bits are equal to 0, we have 2 array elements. The top two bits in all remaining array elements should be 0. The next five bits in all array elements contain array index. Only one bit is used and bit position in this five-bits range defines array index. This means there can be at most five array elements in the future. To define new right the CAPRIGHT() macro must be used. The macro takes two arguments - an array index and a bit to set, eg. #define CAP_PDKILL CAPRIGHT(1, 0x0000000000000800ULL) We still support aliases that combine few rights, but the rights have to belong to the same array element, eg: #define CAP_LOOKUP CAPRIGHT(0, 0x0000000000000400ULL) #define CAP_FCHMOD CAPRIGHT(0, 0x0000000000002000ULL) #define CAP_FCHMODAT (CAP_FCHMOD | CAP_LOOKUP) There is new API to manage the new cap_rights_t structure: cap_rights_t *cap_rights_init(cap_rights_t *rights, ...); void cap_rights_set(cap_rights_t *rights, ...); void cap_rights_clear(cap_rights_t *rights, ...); bool cap_rights_is_set(const cap_rights_t *rights, ...); bool cap_rights_is_valid(const cap_rights_t *rights); void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src); void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src); bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little); Capability rights to the cap_rights_init(), cap_rights_set(), cap_rights_clear() and cap_rights_is_set() functions are provided by separating them with commas, eg: cap_rights_t rights; cap_rights_init(&rights, CAP_READ, CAP_WRITE, CAP_FSTAT); There is no need to terminate the list of rights, as those functions are actually macros that take care of the termination, eg: #define cap_rights_set(rights, ...) \ __cap_rights_set((rights), __VA_ARGS__, 0ULL) void __cap_rights_set(cap_rights_t *rights, ...); Thanks to using one bit as an array index we can assert in those functions that there are no two rights belonging to different array elements provided together. For example this is illegal and will be detected, because CAP_LOOKUP belongs to element 0 and CAP_PDKILL to element 1: cap_rights_init(&rights, CAP_LOOKUP | CAP_PDKILL); Providing several rights that belongs to the same array's element this way is correct, but is not advised. It should only be used for aliases definition. This commit also breaks compatibility with some existing Capsicum system calls, but I see no other way to do that. This should be fine as Capsicum is still experimental and this change is not going to 9.x. Sponsored by: The FreeBSD Foundation
* Typo in strtol(3).pluknet2013-08-301-1/+1
| | | | Noticed by: bde
* Add missing newlines to Fibre Channel attributes output.mav2013-08-271-3/+3
|
* Move the old iSCSI initiator source to a more appropriate placetrasz2013-08-227-7/+7
| | | | | | | | | (sys/dev/iscsi_initiator/ instead of sys/dev/iscsi/initiator/), to make room for the new one. This is also more logical location (kernel module being named iscsi_initiator.ko, for example). There is no ongoing work on this I know of, so it shouldn't make life harder for anyone. There are no functional changes, apart from "svn mv" and adjusting paths.
* Fix the zeroing loop. I must have been drunk when I wrote this...des2013-08-201-6/+6
| | | | MFC after: 3 days
OpenPOWER on IntegriCloud