All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix fast_io_fail capping
@ 2012-03-12 11:56 Jun'ichi Nomura
  0 siblings, 0 replies; only message in thread
From: Jun'ichi Nomura @ 2012-03-12 11:56 UTC (permalink / raw)
  To: device-mapper development, christophe.varoqui

Hi Christophe,

fast_io_fail is only meaningful if it is smaller than dev_loss_tmo.
Setting dev_loss_tmo value to fast_io_fail ends up with -EINVAL.
If the fast_io_fail is not configured properly, turning it off
seems to be the right behavior.

MP_FAST_IO_FAIL_OFF is -1, defined in the following patch:
  [PATCH] Fix for setting '0' to fast_io_fail
  http://www.redhat.com/archives/dm-devel/2012-March/msg00047.html

-- 
Jun'ichi Nomura, NEC Corporation

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 16f786d..8009893 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -307,10 +307,10 @@ sysfs_set_scsi_tmo (struct multipath *mpp)
 			mpp->alias, dev_loss_tmo);
 	}
 	mpp->dev_loss = dev_loss_tmo;
-	if (mpp->fast_io_fail > (int)mpp->dev_loss) {
-		mpp->fast_io_fail = mpp->dev_loss;
-		condlog(3, "%s: update fast_io_fail to %d",
+	if (mpp->dev_loss && mpp->fast_io_fail >= (int)mpp->dev_loss) {
+		condlog(3, "%s: turning off fast_io_fail (%d is not smaller than dev_loss_tmo)",
 			mpp->alias, mpp->fast_io_fail);
+		mpp->fast_io_fail = MP_FAST_IO_FAIL_OFF;
 	}
 	if (!mpp->dev_loss && !mpp->fast_io_fail)
 		return 0;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-03-12 11:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-12 11:56 [PATCH] Fix fast_io_fail capping Jun'ichi Nomura

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.