Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e261af52eb26c22a…
Commit: e261af52eb26c22aebd62cdbd8bb79c195274ee9
Parent: 3f03d46fc13be2274b3c29d4fc97a3306bc33eda
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 9 21:41:50 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 13 15:15:44 2015 +0200
dmeventd: handle snapshot overflow
When snapshot reports overflow, handle it in the same way as Invalid.
Until better ideas are implemented.
---
WHATS_NEW_DM | 1 +
.../dmeventd/plugins/snapshot/dmeventd_snapshot.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index ff4ac22..efe8b37 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.110 -
======================================
+ Dmeventd handles snapshot overflow for now equally as invalid.
Convert dmeventd to use common logging macro system from libdm.
Return -ENOMEM when device registration fails instead of 0 (=success).
Enforce writethrough mode for cleaner policy.
diff --git a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
index ffe6666..ae8e308 100644
--- a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
+++ b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
@@ -150,7 +150,7 @@ void process_event(struct dm_task *dmt,
if (!dm_get_status_snapshot(state->mem, params, &status))
goto out;
- if (status->invalid) {
+ if (status->invalid || status->overflow) {
struct dm_info info;
log_error("Snapshot %s is lost.", device);
if (dm_task_get_info(dmt, &info)) {
@@ -170,7 +170,7 @@ void process_event(struct dm_task *dmt,
* If the snapshot has been invalidated or we failed to parse
* the status string. Report the full status string to syslog.
*/
- if (status->invalid || !status->total_sectors) {
+ if (status->invalid || status->overflow || !status->total_sectors) {
log_error("Snapshot %s changed state to: %s.", device, params);
state->percent_check = 0;
goto out;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3f03d46fc13be227…
Commit: 3f03d46fc13be2274b3c29d4fc97a3306bc33eda
Parent: 0e2721030857088803bc71ccc27644b7b95241ca
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 12 11:35:53 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 13 15:15:43 2015 +0200
man: dmeventd update
---
man/dmeventd.8.in | 92 +++++++++++++++++++++++++++++++++++++---------------
1 files changed, 65 insertions(+), 27 deletions(-)
diff --git a/man/dmeventd.8.in b/man/dmeventd.8.in
index 77bbafb..15e003b 100644
--- a/man/dmeventd.8.in
+++ b/man/dmeventd.8.in
@@ -1,7 +1,11 @@
.TH DMEVENTD 8 "DM TOOLS #VERSION#" "Red Hat Inc" \" -*- nroff -*-
+.
.SH NAME
+.
dmeventd \(em Device-mapper event daemon
+.
.SH SYNOPSIS
+.
.B dmeventd
.RB [ \-d
.RB [ \-d
@@ -11,33 +15,53 @@ dmeventd \(em Device-mapper event daemon
.RB [ \-R ]
.RB [ \-V ]
.RB [ \-? ]
+.
.SH DESCRIPTION
+.
dmeventd is the event monitoring daemon for device-mapper devices.
Library plugins can register and carry out actions triggered when
particular events occur.
-.SH
-LVM PLUGINS
-.TP
-.I Mirror
-Attempts to handle device failure automatically. See \fBlvm.conf\fP(5).
-.TP
-.I Raid
-Attempts to handle device failure automatically. See \fBlvm.conf\fP(5).
-.TP
-.I Snapshot
+.
+.SH LVM PLUGINS
+.
+.HP
+.IR Mirror
+.br
+Attempts to handle device failure automatically. See
+.BR lvm.conf (5).
+.
+.HP
+.IR Raid
+.br
+Attempts to handle device failure automatically. See
+.BR lvm.conf (5).
+.
+.HP
+.IR Snapshot
+.br
Monitors how full a snapshot is becoming and emits a warning to
syslog when it exceeds 80% full.
The warning is repeated when 85%, 90% and 95% of the snapshot is filled.
-See \fBlvm.conf\fP(5).
-.TP
-.I Thin
-Monitors how full a thin pool is becoming and emits a warning to
-syslog when it exceeds 80% full.
+See
+.BR lvm.conf (5).
+Snapshot which runs out of space gets invalid and when it is mounted,
+it gets umounted if possible.
+.
+.HP
+.IR Thin
+.br
+Monitors how full a thin pool data and metadata is becoming and emits
+a warning to syslog when it exceeds 80% full.
The warning is repeated when 85%, 90% and 95% of the thin pool is filled.
-See \fBlvm.conf\fP(5).
+See
+.BR lvm.conf (5).
+If the thin-pool runs out of space, thin volumes are umounted if possible.
+.
.SH OPTIONS
-.TP
-.B \-d
+.
+.HP
+.BR \-d
+.br
Repeat from 1 to 3 times (
.BR \-d ,
.BR \-dd ,
@@ -45,21 +69,35 @@ Repeat from 1 to 3 times (
) to increase the detail of
debug messages sent to syslog.
Each extra d adds more debugging information.
-.TP
-.B \-f
+.
+.HP
+.BR \-f
+.br
Don't fork, run in the foreground.
-.TP
-.BR \-h ", " \-?
+.
+.HP
+.BR \-h
+.br
Show help information.
-.TP
-.B \-R
+.
+.HP
+.BR \-?
+.br
+Show help information on stderr.
+.
+.HP
+.BR \-R
+.br
Replace a running dmeventd instance. The running dmeventd must be version
2.02.77 or newer. The new dmeventd instance will obtain a list of devices and
events to monitor from the currently running daemon.
-.TP
-.B \-V
+.
+.HP
+.BR \-V
+.br
Show version of dmeventd.
-
+.
.SH SEE ALSO
+.
.BR lvm (8),
.BR lvm.conf (5)
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=13086c2523a00bc8…
Commit: 13086c2523a00bc8501113f56094312bda4881e1
Parent: 42a9c8b4a659a44bef1b3150eb6359d562938ca3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 9 22:08:01 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 13 15:15:43 2015 +0200
dmeventd: drop changing logging
As we now use 'unified' logging macro system - we no longer need
to protect from change of logging function pointer - it's set
once at the start of dmeventd and not change anymore
(as lvm2 library no longer interferers here).
---
daemons/dmeventd/dmeventd.c | 10 ----------
1 files changed, 0 insertions(+), 10 deletions(-)
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index 6f25379..0acb919 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -648,7 +648,6 @@ static sigset_t _unblock_sigalrm(void)
/* Wait on a device until an event occurs. */
static int _event_wait(struct thread_status *thread, struct dm_task **task)
{
- static unsigned _in_event_counter = 0;
sigset_t set;
int ret = DM_WAIT_RETRY;
struct dm_task *dmt;
@@ -667,16 +666,11 @@ static int _event_wait(struct thread_status *thread, struct dm_task **task)
!dm_task_set_event_nr(dmt, thread->event_nr))
goto out;
- _lock_mutex();
/*
* Check if there are already some waiting events,
* in this case the logging is unmodified.
* TODO: audit libdm thread usage
*/
- if (!_in_event_counter++)
- dm_log_init(_dmeventd_log);
- _unlock_mutex();
-
DEBUGLOG("Starting waitevent task for %s", thread->device.uuid);
/*
* This is so that you can break out of waiting on an event,
@@ -708,10 +702,6 @@ static int _event_wait(struct thread_status *thread, struct dm_task **task)
DEBUGLOG("Completed waitevent task for %s", thread->device.uuid);
pthread_sigmask(SIG_SETMASK, &set, NULL);
- _lock_mutex();
- if (--_in_event_counter == 0)
- dm_log_init(NULL);
- _unlock_mutex();
out:
if (ret == DM_WAIT_FATAL || ret == DM_WAIT_RETRY) {