Hi Vadym, moving the discussion to the -dev list, which is the more appropriate forum for this. Please reply to -dev; more comments inline.
On Sun, May 20, 2012 at 9:52 PM, Vadym Chepkov <[email protected]> wrote: > Hi, > > > The monitor operation of iSCSILogicalUnit is not specific enough in the > regular expression and I got very "nice" fencing going because it was falsely > reporting "failed to stop" resource. > > I happened to add primitive lun-build10, while already having lun-build1. It would be bad if _that_ caused problems, but I'm unsure how that would be related to your patch. > For myself I have narrowed it down to the following fix, but probably a more > appropriate regex has to be applied to these and other commands serving the > same purpose for other iSCSI implementations. > > diff --git a/heartbeat/iSCSILogicalUnit b/heartbeat/iSCSILogicalUnit > index 25ee32e..2cee970 100755 > --- a/heartbeat/iSCSILogicalUnit > +++ b/heartbeat/iSCSILogicalUnit > @@ -328,7 +328,7 @@ iSCSILogicalUnit_monitor() { > tgt) > # Figure out and set the target ID > TID=`tgtadm --lld iscsi --op show --mode target \ > - | sed -ne "s/^Target \([[:digit:]]\+\): > ${OCF_RESKEY_target_iqn}/\1/p"` > + | sed -ne "s/^Target \([[:digit:]]\+\): > ${OCF_RESKEY_target_iqn}$/\1/p"` Adding the end-of-line anchor there does make good sense, but it would only fix the case of there being two _targets_ sharing part of their IQN, not two LUs with primitives similarly named. Do you have more than one target, where the full IQN of one target is a substring of the IQN of another? > if [ -z "$TID" ]; then > # Our target is not configured, thus we're not > # running. > @@ -337,7 +337,7 @@ iSCSILogicalUnit_monitor() { > # This only looks for the backing store, but does not test > # for the correct target ID and LUN. > tgtadm --lld iscsi --op show --mode target \ > - | grep -E -q "[[:space:]]+Backing store.*: > ${OCF_RESKEY_path}" && return $OCF_SUCCESS > + | grep -E -q "[[:space:]]+Backing store.*: > ${OCF_RESKEY_path}$" && return $OCF_SUCCESS > ;; > lio) Here the "$" looks OK too, but here it would apply to two backing devices with overlapping paths. I presume you named your LVs "lun-build1" and "lun-build10" also, and they're in the same VG? Cheers, Florian -- Need help with High Availability? http://www.hastexo.com/now _______________________________________________ Linux-HA mailing list [email protected] http://lists.linux-ha.org/mailman/listinfo/linux-ha See also: http://linux-ha.org/ReportingProblems
