Blame SOURCES/bz1265426-1-fence_scsi_hard.patch

e4ffb1
From 8cd85ba88193f9cdb0c933ba9f7261f1c3631868 Mon Sep 17 00:00:00 2001
e4ffb1
From: John Ruemker <jruemker@redhat.com>
e4ffb1
Date: Tue, 22 Sep 2015 17:52:56 -0400
e4ffb1
Subject: [PATCH 1/4] fence_scsi: Reset device prior to all uses of sg_persist
e4ffb1
e4ffb1
Currently the agent will reset prior to several areas where it runs
e4ffb1
sg_persist, to clear out any "Unit Attention" conditions that could
e4ffb1
otherwise cause the sg_persist command to report failures.  However
e4ffb1
several paths remain that could fail if a "Unit Attention" condition
e4ffb1
exist, so we should reset before any use of sg_persist.
e4ffb1
---
e4ffb1
 fence/agents/scsi/fence_scsi.py | 4 ++++
e4ffb1
 1 file changed, 4 insertions(+)
e4ffb1
e4ffb1
diff --git a/fence/agents/scsi/fence_scsi.py b/fence/agents/scsi/fence_scsi.py
e4ffb1
index e18e473..8680828 100644
e4ffb1
--- a/fence/agents/scsi/fence_scsi.py
e4ffb1
+++ b/fence/agents/scsi/fence_scsi.py
e4ffb1
@@ -125,6 +125,7 @@ def is_block_device(dev):
e4ffb1
 
e4ffb1
 # cancel registration
e4ffb1
 def preempt_abort(options, host, dev):
e4ffb1
+	reset_dev(options,dev)
e4ffb1
 	cmd = options["--sg_persist-path"] + " -n -o -A -T 5 -K " + host + " -S " + options["--key"] + " -d " + dev
e4ffb1
 	return not bool(run_cmd(options, cmd)["err"])
e4ffb1
 
e4ffb1
@@ -147,11 +148,13 @@ def register_dev(options, dev):
e4ffb1
 
e4ffb1
 
e4ffb1
 def reserve_dev(options, dev):
e4ffb1
+	reset_dev(options,dev)
e4ffb1
 	cmd = options["--sg_persist-path"] + " -n -o -R -T 5 -K " + options["--key"] + " -d " + dev
e4ffb1
 	return not bool(run_cmd(options, cmd)["err"])
e4ffb1
 
e4ffb1
 
e4ffb1
 def get_reservation_key(options, dev):
e4ffb1
+	reset_dev(options,dev)
e4ffb1
 	cmd = options["--sg_persist-path"] + " -n -i -r -d " + dev
e4ffb1
 	out = run_cmd(options, cmd)
e4ffb1
 	if out["err"]:
e4ffb1
@@ -161,6 +164,7 @@ def get_reservation_key(options, dev):
e4ffb1
 
e4ffb1
 
e4ffb1
 def get_registration_keys(options, dev):
e4ffb1
+	reset_dev(options,dev)
e4ffb1
 	keys = []
e4ffb1
 	cmd = options["--sg_persist-path"] + " -n -i -k -d " + dev
e4ffb1
 	out = run_cmd(options, cmd)
e4ffb1
-- 
e4ffb1
2.4.3
e4ffb1