[PATCH 4/4] libmultipath: only warn once about unsupported dev_loss_tmo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Martin Wilck <mwilck@xxxxxxxx>

On systems with many devices, the warning that setting dev_loss_tmo
is unsupported for certain protocols is printed many times, cluttering
the logs. Only print this message once per unsupported protocol.

Signed-off-by: Martin Wilck <mwilck@xxxxxxxx>
---
 libmultipath/discovery.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index c165d9b..b969fba 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -843,6 +843,7 @@ sysfs_set_scsi_tmo (struct multipath *mpp, unsigned int checkint)
 	int i;
 	unsigned int dev_loss_tmo = mpp->dev_loss;
 	struct path *err_path = NULL;
+	STATIC_BITFIELD(bf, LAST_BUS_PROTOCOL_ID + 1);
 
 	if (mpp->no_path_retry > 0) {
 		uint64_t no_path_retry_tmo =
@@ -897,12 +898,13 @@ sysfs_set_scsi_tmo (struct multipath *mpp, unsigned int checkint)
 		sysfs_set_eh_deadline(mpp, pp);
 	}
 
-	if (err_path) {
+	if (err_path && !is_bit_set_in_bitfield(bus_protocol_id(pp), bf)) {
 		STRBUF_ON_STACK(proto_buf);
 
 		snprint_path_protocol(&proto_buf, err_path);
 		condlog(2, "%s: setting dev_loss_tmo is unsupported for protocol %s",
 			mpp->alias, get_strbuf_str(&proto_buf));
+		set_bit_in_bitfield(bus_protocol_id(pp), bf);
 	}
 	return 0;
 }
-- 
2.35.1


--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux