summaryrefslogtreecommitdiff
path: root/sys/geom/mirror/g_mirror.c
Commit message (Collapse)AuthorAgeFilesLines
* Make MAXPHYS tunable. Bump MAXPHYS to 1M.Konstantin Belousov2020-11-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace MAXPHYS by runtime variable maxphys. It is initialized from MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys. Make b_pages[] array in struct buf flexible. Size b_pages[] for buffer cache buffers exactly to atop(maxbcachebuf) (currently it is sized to atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1. The +1 for pbufs allow several pbuf consumers, among them vmapbuf(), to use unaligned buffers still sized to maxphys, esp. when such buffers come from userspace (*). Overall, we save significant amount of otherwise wasted memory in b_pages[] for buffer cache buffers, while bumping MAXPHYS to desired high value. Eliminate all direct uses of the MAXPHYS constant in kernel and driver sources, except a place which initialize maxphys. Some random (and arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted straight. Some drivers, which use MAXPHYS to size embeded structures, get private MAXPHYS-like constant; their convertion is out of scope for this work. Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs, dev/siis, where either submitted by, or based on changes by mav. Suggested by: mav (*) Reviewed by: imp, mav, imp, mckusick, scottl (intermediate versions) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27225 Notes: svn path=/head/; revision=368124
* Make g_attach() return ENXIO for orphaned providers; update variousEdward Tomasz Napierala2020-10-181-3/+5
| | | | | | | | | | | | | classes to add missing error checking. Reviewed by: imp MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26658 Notes: svn path=/head/; revision=366811
* geom: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-2/+0
| | | | Notes: svn path=/head/; revision=365226
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-1/+1
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* Pass BIO_SPEEDUP through all the geom layersWarner Losh2020-01-171-1/+10
| | | | | | | | | | | | | | | While some geom layers pass unknown commands down, not all do. For the ones that don't, pass BIO_SPEEDUP down to the providers that constittue the geom, as applicable. No changes to vinum or virstor because I was unsure how to add this support, and I'm also unsure how to test these. gvinum doesn't implement BIO_FLUSH either, so it may just be poorly maintained. gvirstor is for testing and not supportig BIO_SPEEDUP is fine. Reviewed by: chs Differential Revision: https://reviews.freebsd.org/D23183 Notes: svn path=/head/; revision=356818
* Add KERNEL_PANICKED macro for use in place of direct panicstr testsMateusz Guzik2020-01-121-1/+1
| | | | Notes: svn path=/head/; revision=356655
* GEOM: Reduce unnecessary log interleaving with sbufsConrad Meyer2019-08-071-0/+1
| | | | | | | | | | | | | | | Similar to what was done for device_printfs in r347229. Convert g_print_bio() to a thin shim around g_format_bio(), which acts on an sbuf; documented in g_bio.9. Reviewed by: markj Discussed with: rlibby Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21165 Notes: svn path=/head/; revision=350694
* g_mirror_taste: avoid deadlock, always clear tasting flagRyan Libby2019-07-011-1/+1
| | | | | | | | | | | | | | | | | | | | If g_mirror_taste encountered an error at g_mirror_add_disk, it might try to g_mirror_destroy the device with the G_MIRROR_DEVICE_FLAG_TASTING flag still set. This would wait on a worker to complete the destruction with g_mirror_try_destroy, but that function bails out if the tasting flag is set, resulting in a deadlock. Clear the tasting flag before trying to destroy the device. Test Plan: sysctl debug.fail_point.mnowait="1%return" kyua test -k /usr/tests/sys/geom/class/mirror/Kyuafile Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20744 Notes: svn path=/head/; revision=349587
* Use sbuf_cat() in GEOM confxml generation.Alexander Motin2019-06-191-15/+15
| | | | | | | | | | | When it comes to megabytes of text, difference between sbuf_printf() and sbuf_cat() becomes substantial. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=349195
* Use g_handleattr() to reply to GEOM::candelete queries.Mark Johnston2019-01-021-4/+3
| | | | | | | | | | | | | | | g_handleattr() fills out bp->bio_completed; otherwise, g_getattr() returns an error in response to the query. This caused BIO_DELETE support to not be propagated through stacked configurations, e.g., a gconcat of gmirror volumes would not handle BIO_DELETE even when the gmirrors do. g_io_getattr() was not affected by the problem. PR: 232676 Reported and tested by: noah.bergbauer@tum.de MFC after: 1 week Notes: svn path=/head/; revision=342687
* gmirror: Remove a last-minute INVARIANTS breakage in r341840Conrad Meyer2018-12-121-2/+0
| | | | | | | | | | | | | I mistakenly added a lock assertion to this routine at the last minute without confirming it was held during g_mirror_create. It isn't (it isn't even initialized yet). Mea culpa. Access is exclusive in both callers, just not always by that particular lock. Reported by: lwhsu X-MFC-With: r341840, r341674 Notes: svn path=/head/; revision=341994
* gmirror: Fix a bug introduced in r341674Conrad Meyer2018-12-121-1/+4
| | | | | | | | | | | | | | | r341674 inadvertently introduced a bug where newer mirror components being tasted would clear the high sc_flags that are not controlled by component metadata, such as G_MIRROR_DEVICE_FLAG_TASTING. This could plausibly expose a small window of time during STARTING where device destruction might race with mirror component addition, probably resulting in a crash. Reviewed by: markj X-MFC-With: r341674 Differential Revision: https://reviews.freebsd.org/D18521 Notes: svn path=/head/; revision=341840
* gmirror: Evaluate mirror components against newest metadata copyConrad Meyer2018-12-071-79/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-apply r341665 with format strings fixed. If we happen to taste a stale mirror component first, don't reject valid, newer components that have differing metadata from the stale component (during STARTING). Instead, update our view of the most recent metadata as we taste components. Like mediasize beforehand, remove some checks from g_mirror_check_metadata which would evict valid components due to metadata that can change over a mirror's lifetime. g_mirror_check_metadata is invoked long before we check genid/syncid and decide which component(s) are newest and whether or not we have quorum. Before checking if we can enter RUNNING (i.e., we have quorum) after a NEW component is added, first remove any known stale or inconsistent disks from the mirrorset, rather than removing them *after* deciding we have quorum. Check if we have quorum after removing these components. Additionally, add a knob, kern.geom.mirror.launch_mirror_before_timeout, to force gmirrors to wait out the full timeout (kern.geom.mirror.timeout) before transitioning from STARTING to RUNNING. This is a kludge to help ensure all eligible, boot-time available mirror components are tasted before RUNNING a gmirror. Add a basic test case for STARTING -> RUNNING startup behavior around stale genids. PR: 232671, 232835 Submitted by: Cindy Yang <cyang AT isilon.com> (previous version) Reviewed by: markj (kernel portions) Discussed with: asomers, Cindy Yang Tested by: pho Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D18062 Notes: svn path=/head/; revision=341674
* Revert r341665 due to tinderbox breakageConrad Meyer2018-12-071-162/+79
| | | | | | | | I didn't notice that some format strings were non-portable. Will fix and re-commit later. Notes: svn path=/head/; revision=341672
* gmirror: Evaluate mirror components against newest metadata copyConrad Meyer2018-12-061-79/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we happen to taste a stale mirror component first, don't reject valid, newer components that have differing metadata from the stale component (during STARTING). Instead, update our view of the most recent metadata as we taste components. Like mediasize beforehand, remove some checks from g_mirror_check_metadata which would evict valid components due to metadata that can change over a mirror's lifetime. g_mirror_check_metadata is invoked long before we check genid/syncid and decide which component(s) are newest and whether or not we have quorum. Before checking if we can enter RUNNING (i.e., we have quorum) after a NEW component is added, first remove any known stale or inconsistent disks from the mirrorset, rather than removing them *after* deciding we have quorum. Check if we have quorum after removing these components. Additionally, add a knob, kern.geom.mirror.launch_mirror_before_timeout, to force gmirrors to wait out the full timeout (kern.geom.mirror.timeout) before transitioning from STARTING to RUNNING. This is a kludge to help ensure all eligible, boot-time available mirror components are tasted before RUNNING a gmirror. When we are instructed to forget mirror components, bump the generation id to avoid confusion with such stale components later. Add a basic test case for STARTING -> RUNNING startup behavior around stale genids. PR: 232671, 232835 Submitted by: Cindy Yang <cyang AT isilon.com> (previous version) Reviewed by: markj (kernel portions) Discussed with: asomers, Cindy Yang Tested by: pho Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D18062 Notes: svn path=/head/; revision=341665
* Remove a redundant assertion.Mark Johnston2018-05-061-1/+0
| | | | | | | | MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=333279
* Avoid dropping the topology lock in gmirror's dumpconf implementation.Mark Johnston2018-05-061-15/+9
| | | | | | | | | | | | | | | | Doing so introduces races which can lead to a use-after-free when grabbing a snapshot of the GEOM mesh. To ensure that a mirror's disk list remains stable, change its locking protocol: both the softc lock and the topology lock are now required to modify the list, so either lock is sufficient for traversal. Tested by: pho MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=333278
* Annotate geom modules with MODULE_VERSIONKyle Evans2018-04-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | GEOM ELI may double ask the password during boot. Once at loader time, and once at init time. This happens due a module loading bug. By default GEOM ELI caches the password in the kernel, but without the MODULE_VERSION annotation, the kernel loads over the kernel module, even if the GEOM ELI was compiled into the kernel. In this case, the newly loaded module purges/invalidates/overwrites the GEOM ELI's password cache, which causes the double asking. MFC Note: There's a pc98 component to the original submission that is omitted here due to pc98 removal in head. This part will need to be revived upon MFC. Reviewed by: imp Submitted by: op Obtained from: opBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14992 Notes: svn path=/head/; revision=332387
* Simplify synchronization read error handling.Mark Johnston2018-02-061-24/+7
| | | | | | | | | | | | | | | Since synchronization reads are performed by submitting a request to the external mirror provider, we know that the request returns with an error only when gmirror was unable to read a copy of the block from any mirror. Thus, there is no need to retry the request from the synchronization error handler. Tested by: pho MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=328938
* Fix handling of read errors during mirror synchronization.Mark Johnston2018-01-101-47/+85
| | | | | | | | | | | | | | | | | | We would previously just free the request BIO, which would either cause the disk to stay stuck in the SYNCHRONIZING state, or result in synchronization completing without having copied the block which returned an error. With this change, if the disk which returned an error is the only active disk in the mirror, the synchronizing disk is kicked out. Otherwise, the read is retried. Reported and tested by: pho (previous version) MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=327779
* Avoid referencing a possibly freed consumer after r327496.Mark Johnston2018-01-101-8/+7
| | | | | | | | | | | | g_mirror_regular_request() may free the gmirror consumer for a disk if that disk is being disconnected, after which we must not dereference the consumer pointer. CID: 1384280 X-MFC with: r327496 Notes: svn path=/head/; revision=327760
* Sort and remove unneeded includes.Mark Johnston2018-01-081-8/+8
| | | | | | | | MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=327700
* Release the queue lock before restarting the worker loop.Mark Johnston2018-01-081-1/+3
| | | | | | | | | Reported and tested by: pho MFC after: 3 days Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=327698
* Fix some I/O ordering issues in gmirror.Mark Johnston2018-01-021-139/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | - BIO_FLUSH requests were dispatched to the disks directly from g_mirror_start() rather than going through the mirror's I/O request queue, so they could have been reordered with preceding writes. Address this by processing such requests from the queue, avoiding direct dispatch. - Handling for collisions with synchronization requests was too fine-grained and could cause reordering of writes. In particular, BIO_ORDERED was not being honoured. Address this by effectively freezing the request queue any time a collision with a synchronization request occurs. The queue is unfrozen once the collision with the first frozen request is over. - The above-mentioned collision handling allowed reads to jump ahead of writes to the same offset. Address this by freezing all request types when a collision occurs, not just BIO_WRITEs and BIO_DELETEs. Also add some more fail points for use in testing error handling. Reviewed by: imp MFC after: 3 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D13559 Notes: svn path=/head/; revision=327496
* Avoid using bioq_* in gmirror.Mark Johnston2017-12-191-40/+52
| | | | | | | | | | | | | | | | gmirror does not perform any sorting of I/O requests, so the bioq API doesn't provide any advantages over plain TAILQs. The API also does not provide operations needed by an upcoming change. No functional change intended. The diff shrinks the geom_mirror.ko text and the gmirror softc slightly. Tested by: pho (part of a larger patch) MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=326983
* Give a couple of predication functions a bool return type.Mark Johnston2017-12-151-8/+8
| | | | | | | | | | No functional change intended. MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=326882
* Typo.Mark Johnston2017-12-151-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=326881
* Address a possible lost wakeup for gmirror events.Mark Johnston2017-12-121-9/+2
| | | | | | | | | | | | | g_mirror_event_send() acquires the I/O queue lock to deliver a wakeup to the worker thread, and this is done after enqueuing the event. So it's sufficient to check the event queue before atomically releasing the queue lock and going to sleep. MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=326798
* Give g_mirror_event_get() a more accurate name.Mark Johnston2017-12-121-3/+3
| | | | | | | | MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=326797
* Decrement sc_writes when BIO_DELETE requests complete.Mark Johnston2017-12-121-1/+1
| | | | | | | | | | | Otherwise a gmirror that has received a BIO_DELETE request will never be marked clean (unless sc_writes overflows). MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=326796
* Update gmirror metadata less frequently when synchronizing.Mark Johnston2017-11-301-2/+8
| | | | | | | | | | | | | | | | | We periodically record synchronization progress in the metadata block of the disk being synchronized; this allows an interrupted synchronization to be resumed. However, the frequency of these updates heavily pessimized synchronization time on some media. This change modifies gmirror to update metadata based on a time period, and adds a sysctl to control that period. The default value results in a much lower update frequency and increases the completion time for an interrupted rebuild only marginally. Reported by: Andre Albsmeier <andre@fbsd.e4m.org> MFC after: 3 weeks Notes: svn path=/head/; revision=326409
* sys/geom: adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326270
* Allow kern.geom.mirror.debug to be negative.Mark Johnston2017-11-231-2/+2
| | | | | | | | | | | A negative value can be used to suppress all prints from the gmirror kernel code, which can be useful when attempting to trigger race conditions using stress tests. MFC after: 1 week Notes: svn path=/head/; revision=326132
* Fix a lock leak in g_mirror_destroy().Mark Johnston2017-10-271-1/+3
| | | | | | | | | | | | g_mirror_destroy() is supposed to unlock the softc before indicating success, but it wasn't doing so if the caller raced with another thread destroying the mirror. MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325044
* gmirror: treat ENXIO as disk disconnect, not media errorAndriy Gapon2017-09-151-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In theory, all data access errors mean that a member is out of sync at most. But they were treated as more serious errors to avoid the situation where a flaky disk gets repeatedly disconnected, re-synchronized, reconnected and then disconnected again. ENXIO is a special error that means that the member disk disappeared, so it should get the same handling as the GEOM orphaning event. There is a better chance that when the disk is reconnected, it will be a good member again. When ENXIO happens on a read we use the exisiting G_MIRROR_BUMP_SYNCID mechanism which means that the mirror's syncid is increased as soon as there is a write to the mirror. That's because no data has got out of sync yet, but the problematic memeber is disconnected, so the future write will make it stale. When ENXIO happens on a write we use a new G_MIRROR_BUMP_SYNCID_NOW mechanism which means that we update the mirror metadata as soon as possible because the problematic memeber is already behind. Reviewed by: markj, imp MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D9463 Notes: svn path=/head/; revision=323612
* Synchronize unclean mirrors before adding them to a running gmirror.Mark Johnston2017-05-021-1/+3
| | | | | | | | | | | | | | | During gmirror startup, if component mirrors are found to be dirty as is typical after a system crash, the mirrors are synchronized to the mirror with highest priority. However if a gmirror starts without all of its mirrors present, for example because of some transient delays during tasting, the remaining mirrors must be synchronized before they may become active. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=317712
* Rename two gmirror state flags to make their meanings slightly clearer.Mark Johnston2017-04-141-7/+7
| | | | | | | | | | No functional change. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316869
* Don't set the mirror GEOM softc to NULL in g_mirror_destroy().Mark Johnston2017-04-141-8/+1
| | | | | | | | | | | | | | | | | At this point we have not rendezvous'ed with the mirror worker thread, and I/O may still be in flight. Various I/O completion paths expect to be able to obtain a reference to the mirror softc from the GEOM, so setting it to NULL may result in various NULL pointer dereferences if the mirror is stopped with -f or the kernel is shut down while a mirror is synchronizing. The worker thread will clear the softc pointer before exiting. Tested by: pho MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316867
* Check for a provider error before enqueuing mirror I/O.Mark Johnston2017-04-141-0/+5
| | | | | | | | | | | | | We are otherwise susceptible to a race with a concurrent teardown of the mirror provider, causing the I/O to be left uncompleted after the mirror started withering. Tested by: pho MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316866
* Stop mirror synchronization before draining the I/O queue.Mark Johnston2017-04-141-4/+5
| | | | | | | | | | | | | | | Regular I/O requests may be blocked by concurrent synchronization requests targeted to the same LBAs, in which case they are moved to a holding queue until the conflicting I/O completes. We therefore want to stop synchronization before completing pending I/O in g_mirror_destroy_provider() since this ensures that blocked I/O requests are completed as well. Tested by: pho MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316859
* Handle NULL entries in gmirror disk ds_bios arrays.Mark Johnston2017-04-101-5/+9
| | | | | | | | | | | | | | | | Entries may be removed and freed if an I/O error occurs during mirror synchronization, so we cannot assume that all entries of ds_bios are valid. Also ensure that a synchronization BIO's array index is preserved after a successful write. Reported and tested by: pho MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316681
* Avoid sleeping when the mirror I/O queue is non-empty.Mark Johnston2017-03-291-0/+4
| | | | | | | | | | | | | A request may be queued while the queue lock is dropped when the mirror is being destroyed. The corresponding wakeup would be lost, possibly resulting in an apparent hang of the mirror worker thread. Tested by: pho (part of a larger patch) MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316175
* Remove an unneeded g_mirror_destroy_provider() call.Mark Johnston2017-03-291-4/+1
| | | | | | | | | | | | | The worker thread will destroy the mirror provider as part of its teardown sequence. The call made sense in the initial revision of gmirror, but became unnecessary in r137248. Tested by: pho (part of a larger diff) MFC afteR: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316174
* Refine r301173 a bit.Mark Johnston2017-03-271-1/+4
| | | | | | | | | | | | | | | - Don't execute any of g_mirror_shutdown_post_sync() when panicking. We cannot safely idle the mirror or stop synchronization in that state, and the current attempts to do so complicate debugging of gmirror itself. - Check for a non-NULL panicstr instead of using SCHEDULER_STOPPED(). The latter was added for use in the locking primitives. Reviewed by: mav, pjd MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316032
* Add `gmirror create` subcommand, alike to gstripe, gconcat, etc.Alexander Motin2016-11-301-3/+24
| | | | | | | | | | | | It is quite specific mode of operation without storing on-disk metadata. It can be useful in some cases in combination with some external control tools handling mirror creation and disks hot-plug. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=309321
* Use providergone method to cover race between destroy and g_access().Alexander Motin2016-11-131-27/+39
| | | | | | | | | Reviewed by: markj MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=308608
* gmirror: Add a subroutine to free synchronization BIOs.Mark Johnston2016-10-201-11/+21
| | | | | | | | | | | This addresses a memory leak that occurs upon an I/O error during a mirror synchronization. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=307692
* gmirror: Release pending regular requests when synchronization stops.Mark Johnston2016-10-201-7/+1
| | | | | | | | | | | | | | | | | | Normally gmirror allows colliding requests to proceed whenever a synchronization request completes and advances to the next offset. However if an I/O request collides with one of the final g_mirror_syncreqs, nothing releases it once synchronization completes, resulting in an apparent I/O hang. The same problem can occur if synchronization is aborted by an I/O error. Therefore, be sure to requeue pending requests when mirror synchronization is stopped for any reason. While here, remove some dead code from g_mirror_regular_release(). MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=307691
* Fix possible geom destruction before final provider close.Alexander Motin2016-10-061-27/+15
| | | | | | | | | | | Introduce internal counter to track opens. Using provider's counters is not very successfull after calling g_wither_provider(). MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=306762
* gmirror: Write an updated syncid before queuing writes.Mark Johnston2016-10-061-7/+8
| | | | | | | | | | | | | | When a syncid bump is pending, any write to the mirror results in the updated syncid being written to each component's metadata block. However, the update was only being performed after the writes to the mirror componenents were queued. Instead, synchronously update the metadata block first. MFC after: 3 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=306744