summaryrefslogtreecommitdiff
path: root/daemons/lvmlockd
Commit message (Collapse)AuthorAgeFilesLines
* Revert "lvmlockd: use commonly used define NOTIFYDBUS_SUPPORT"David Teigland2019-09-162-8/+15
| | | | | | This reverts commit 71af650760c2b75b3c267277f47d8ba235421300. It disabled sd_notify() which broke 'systemctl start lvmlockd'.
* lvmlockd: fix snprintf warningsDavid Teigland2019-05-023-12/+24
|
* lvextend: refresh shared LV without using selectDavid Teigland2019-04-041-3/+2
| | | | | Using select instead of normal args did not end up being a help, so remove it.
* lvextend: refresh shared LV with vgname as argDavid Teigland2019-03-221-1/+2
| | | | | | | Update the previous commit to leave the vgname as an arg instead of moving it into the select option, (the compound select option rule is confusing the dlm arg processing.)
* lvextend: refresh shared LV using select optionDavid Teigland2019-03-221-1/+33
| | | | | | | | Using --select 'lvname=LV && vgname=VG' avoids the problem of the lvchange exit code not distinguishing an actual error result vs the VG or LV not existing. (This is in case there is an odd dlm/gfs2 setup where some nodes are running the dlm but do not have access to the VG.)
* lvextend: refresh shared LV remotely using dlm/corosyncDavid Teigland2019-03-214-0/+127
| | | | | | | | | When lvextend extends an LV that is active with a shared lock, use this as a signal that other hosts may also have the LV active, with gfs2 mounted, and should have the LV refreshed to reflect the new size. Use the libdlmcontrol run api, which uses dlm_controld/corosync to run an lvchange --refresh command on other cluster nodes.
* lvextend: allow on LV active with a shared lockDavid Teigland2019-03-212-1/+5
| | | | | Detect when a shared lock exists, don't require the normal exclusive lock, and allow the lvextend.
* warn about changes to an active lv with shared lockDavid Teigland2019-03-212-0/+42
| | | | | | | | | | When an LV is active with a shared lock, a command can be run to change the LV with --lockopt skiplv (to override the exclusive lock the command ordinarily requires which is not compatible with the outstanding shared lock.) In this case, other commands may have the LV active and may need to refresh the LV, so print warning stating this.
* lvmlockd: make lockstart wait for existing startDavid Teigland2019-01-161-3/+6
| | | | | | | | | | | | | | | | | | If there are two independent scripts doing: vgchange --lockstart vg lvchange -ay vg/lv The first vgchange to do the lockstart will wait for the lockstart to complete before returning. The second vgchange to do the lockstart will see that the start is already in progress (from the first) and will do nothing. This means the second does not wait for any lockstart to complete, and moves on to the lvchange which may find the lockspace still starting and fail. To fix this, make the vgchange lockstart command wait for any lockstart's in progress to complete.
* cleanup: use zallocZdenek Kabelac2018-12-223-8/+4
| | | | Some places forget to use zalloc().
* cov: fix memleak on error pathZdenek Kabelac2018-12-221-1/+2
| | | | Do not leak lvs pointer on error path.
* Revert "lvmlockd: Fix arguments when built without sanlock"Zdenek Kabelac2018-12-211-2/+2
| | | | | | This reverts commit b068f21f6a24094936a33269067c18373b48f2cd. This revert was incorrect.
* lvmlockd: drop superfluous definesZdenek Kabelac2018-12-211-3/+0
| | | | | These defines are automatically granted with _GNU_SOURCE which is use for whole compilation via configure.h.
* lvmlockd: use commonly used define NOTIFYDBUS_SUPPORTZdenek Kabelac2018-12-212-15/+8
| | | | | Build with configured NOTIFYDBUS_SUPPORT, SYSTEMD_LIBS, SYSTEMD_CFLAGS. Also add proper build dependencies on internal libraries.
* lvmlockd: Fix arguments when built without sanlockMarian Csontos2018-12-181-2/+2
| | | | (cherry picked from commit 24254ca86671ae49431e67788c039603fe4b79fb)
* headers: use configure.h as 1st. headerZdenek Kabelac2018-12-141-1/+0
| | | | | | | | | | | Ensure configure.h is always 1st. included header. Maybe we could eventually introduce gcc -include option, but for now this better uses dependency tracking. Also move _REENTRANT and _GNU_SOURCE into configure.h so it doesn't need to be present in various source files. This ensures consistent compilation of headers like stdio.h since it may produce different declaration.
* makefiles: updates for less verbosityZdenek Kabelac2018-11-291-4/+8
|
* lvmlockctl: wait by default when stoppingDavid Teigland2018-11-271-1/+1
| | | | | lvmlockctl --stop-lockspaces was by default not waiting for all the lockspaces to be gone.
* sanlock: update headersZdenek Kabelac2018-11-191-2/+2
|
* debug: tracing fclose failureZdenek Kabelac2018-11-051-2/+5
| | | | | Using log_debug (not returning error code) to trace possible failure of fclose().
* lvmlockd: use standard major minor functionsDavid Teigland2018-11-021-2/+2
|
* lvmlockd: fix handling of sanlock release errorDavid Teigland2018-11-021-5/+13
| | | | | | | | When sanlock_release returns an error because of an i/o timeout releasing the lease on disk, lvmlockd should just consider the lock released. sanlock will continue trying to release the lease on disk after the original request times out.
* lvmlockd: use new sanlock sector/align interfaceDavid Teigland2018-11-013-39/+301
| | | | | | | | | The choice about sector size and lease align size is now made by the sanlock user, in this case lvmlockd. This will allow lvmlockd to use other lease sizes in the future. This also prevents breakage if hosts report different sector sizes, or the sector size reported by a device changes.
* build: gcc can be fussy about order of libsMarian Csontos2018-10-101-1/+1
|
* lvmlockd: improve systemd service fileDavid Teigland2018-09-132-0/+16
| | | | | use notify type so the daemon is ready immediately after start.
* Remove lvmetadDavid Teigland2018-07-111-111/+24
| | | | | | | | | | | | | Native disk scanning is now both reduced and async/parallel, which makes it comparable in performance (and often faster) when compared to lvm using lvmetad. Autoactivation now uses local temp files to record online PVs, and no longer requires lvmetad. There should be no apparent command-level change in behavior.
* build: libbase.aJoe Thornber2018-06-041-4/+2
|
* build: fixesZdenek Kabelac2018-06-041-2/+4
|
* Merge branch 'master' into 2018-05-11-fork-libdmJoe Thornber2018-06-011-9/+29
|\
| * lvmlockd: suppress error messages related to lvmetadDavid Teigland2018-05-181-9/+29
| | | | | | | | | | Log lvmetad related messages as debug, not as errors, when using lvmlockd without lvmetad.
* | Merge branch 'master' into 2018-05-11-fork-libdmJoe Thornber2018-05-161-0/+2
|\ \ | |/
| * build: properly track source file for lmvlockctlZdenek Kabelac2018-05-121-0/+2
| | | | | | | | Ensure the source file is tracked by various cleanup functions.
* | device-mapper: Fork libdm internally.Joe Thornber2018-05-162-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The device-mapper directory now holds a copy of libdm source. At the moment this code is identical to libdm. Over time code will migrate out to appropriate places (see doc/refactoring.txt). The libdm directory still exists, and contains the source for the libdevmapper shared library, which we will continue to ship (though not neccessarily update). All code using libdm should now use the version in device-mapper.
* | build: Don't generate symlinks in include/ dirJoe Thornber2018-05-145-14/+14
|/ | | | | | | As we start refactoring the code to break dependencies (see doc/refactoring.txt), I want us to use full paths in the includes (eg, #include "base/data-struct/list.h"). This makes it more obvious when we're breaking abstraction boundaries, eg, including a file in metadata/ from base/
* sanlock: set proper return valueZdenek Kabelac2018-02-191-1/+1
| | | | | In last patch one error path missed to assign correct return value. Assing it directly to 'ret' as log_error was already reported.
* lvmlockd: improve dm path creation for sanlock LVZdenek Kabelac2018-02-121-5/+38
| | | | | Use devmapper function to create matching dm name with mangling. Drop extra '-1' from buffer passed to snprintf.
* clean: drop unneeded -1 for snprintfZdenek Kabelac2018-02-122-3/+3
| | | | | | man gives: snprintf() and vsnprintf() write at most size bytes (including the terminating null byte ('\0')) to str.
* lvmlock: return an error if lvb cannot be writtenDavid Teigland2017-12-061-2/+2
| | | | | It doesn't make much difference, because if this happens, it means there are other more significant problems.
* lvmlockd: recognize normal errors from sanlock_convertDavid Teigland2017-12-052-10/+19
| | | | | | Don't log an error message for error values returned by sanlock_convert for expected conditions like lock contention or io timeouts.
* lvmlockd: avoid blocking in sanlock_convertDavid Teigland2017-12-051-0/+10
| | | | | | Use the same flag as sanlock_acquire() for the same purpose. sanlock_convert can block like acquire when doing a sh to ex conversion.
* lvmlockd: override unknown lock manager error numbersDavid Teigland2017-11-173-2/+27
| | | | | | | | | | When sanlock or dlm lock managers return an error number that we don't recognize, replace it with a generic -ELMERR which is defined in the set of special lvmlockd error numbers. Otherwise, an unknown lock manager error number could be misinterpreted for something else if it happened to overlap another set of error numbers (which they have not thus far.)
* lvmlockd: retry on other sanlock errorsDavid Teigland2017-11-171-0/+20
| | | | | | | | | | | | | | | These less common errors returned from sanlock should also cause sanlock to retry the lock acquire: - i/o timeout occurs during sanlock_acquire(). other i/o on the same disk as the leases can cause sanlock i/o timeouts. - low level disk paxos contention between hosts naturally causes one host to not acquire the lease. There are a couple special error numbers associated with these cases that should just be recognized as a normal failure to acquire the lease.
* lvmlockd: check error for sanlock access to lvmlock LVDavid Teigland2017-10-172-6/+14
| | | | | When the sanlock daemon does not have permission to access the lvmlock LV, make the error messages more helpful.
* lvmlockd: fix check for no running lock managerDavid Teigland2017-08-291-1/+11
| | | | | In some cases it was reporting there was no running lock manager when there is.
* lvmlockd: print error about starting lock managerDavid Teigland2017-08-281-1/+1
| | | | | | In the case where lvmlockd is running, but no lock manager is running, we should print a specific error message about that situation.
* lvmlockd: log pthread_join errno codeZdenek Kabelac2017-08-251-3/+12
| | | | Log possible errno with pthread_join (and one close() instance).
* lvmlockctl: fix check for failing closeZdenek Kabelac2017-08-251-1/+1
| | | | On close() failure it's -1.
* lvmlockd: avoid double unlock of client_mutexZdenek Kabelac2017-08-251-2/+2
| | | | | | Avoid double unlocking of client_mutex and and unlock client_mutex in 'else' branch since it's already unlocked in 'if (cl->dead)' branch.
* lvmlockd: fix mutex unlockDavid Teigland2017-08-231-1/+2
| | | | | Remove an unwanted pthread_mutex_unlock which would lead to a double unlock.
* lvmlockd: add comment about temp ls nameDavid Teigland2017-08-231-2/+8
|