multipath: add option to change the number of error messages
This patch adds a new default config parameter, log_checker_err. It accepts
two values, "once" and "always", and defaults of "always". It controls
how multipathd logs checker error messages. If it's set to "once", only the
first checker error message is logged at logging level 2. All future messages
are logged at level 3, until the device is restored or removed. If it's set
to "always", all messages are logged at level 2, like multipathd currently does.
+enum log_checker_err_states {
+ LOG_CHKR_ERR_ALWAYS,
+ LOG_CHKR_ERR_ONCE,
+};
+
struct scsi_idlun {
int dev_id;
int host_unique_id;
Index: multipath-tools-111219/multipath/multipath.conf.5
================================================== =================
--- multipath-tools-111219.orig/multipath/multipath.conf.5
+++ multipath-tools-111219/multipath/multipath.conf.5
@@ -316,9 +316,19 @@ cannot be told to stop queueing IO. Sett
.I no
, avoids this problem. Default is
.I yes
+.TP
.B bindings_file
The full pathname of the binding file to be used when the user_friendly_names option is set. Defaults to
.I /var/lib/multipath/bindings
+.TP
+.B log_checker_err
+If set to
+.I once
+, multipathd logs the first path checker error at logging level 2. Any later
+errors are logged at level 3 until the device is restored. If set to
+.I always
+, multipathd always logs the path checker error at logging level 2. Default is
+.I always
.
.SH "blacklist section"
The
Index: multipath-tools-111219/multipathd/main.c
================================================== =================
--- multipath-tools-111219.orig/multipathd/main.c
+++ multipath-tools-111219/multipathd/main.c
@@ -1193,8 +1193,12 @@ check_path (struct vectors * vecs, struc
pp->dev_t, pp->tick);
}
}
- else if (newstate == PATH_DOWN)
- LOG_MSG(2, checker_message(&pp->checker));
+ else if (newstate == PATH_DOWN) {
+ if (conf->log_checker_err == LOG_CHKR_ERR_ONCE)
+ LOG_MSG(3, checker_message(&pp->checker));
+ else
+ LOG_MSG(2, checker_message(&pp->checker));
+ }
pp->state = newstate;
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel