From: Shiva Krishna Subject: [PATCH]multipath-tools: select reservation_key parameter before PR handler for first path addition to new map Date: Fri, 19 Feb 2016 01:49:40 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2994094700930614074==" Return-path: Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: device-mapper development List-Id: dm-devel.ids --===============2994094700930614074== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_D2EBB4B475AFShivaKrishnanimblestoragecom_" --_000_D2EBB4B475AFShivaKrishnanimblestoragecom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On addition of first path, reservation_key parameter is not selected before handling persistent reservations. This leads multipathd to not perform registration on the path even when registrations exist on the LUN. Added code to select "reservation_key" parameter value before calling PR handler during addition of new path to a new map. Signed-off-by: ShivaKrishna Merla --- libmultipath/configure.c | 5 ++++- multipathd/main.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/libmultipath/configure.c b/libmultipath/configure.c index 24ad948..2071aa4 100644 --- a/libmultipath/configure.c +++ b/libmultipath/configure.c @@ -287,7 +287,10 @@ setup_map (struct multipath * mpp, char * params, int = params_size) select_gid(mpp); select_fast_io_fail(mpp); select_dev_loss(mpp); - select_reservation_key(mpp); + + if (!mpp->reservation_key) + select_reservation_key(mpp); + select_retain_hwhandler(mpp); select_deferred_remove(mpp); select_delay_watch_checks(mpp); diff --git a/multipathd/main.c b/multipathd/main.c index 04f6d02..bf3423f 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -539,6 +539,8 @@ rescan: goto fail; /* leave path added to pathvec */ } + /* select configured reservation key */ + select_reservation_key(mpp); /* persistent reseravtion check*/ mpath_pr_event_handle(pp); -- --_000_D2EBB4B475AFShivaKrishnanimblestoragecom_ Content-Type: text/html; charset="us-ascii" Content-ID: <9E0B1475CBE05042B0B0433A9A66964C@nimblestorage.com> Content-Transfer-Encoding: quoted-printable
On addition of first path, reservation_key parameter is not selected b= efore
handling persistent reservations. This leads multipathd to not perform=
registration on the path even when registrations exist on the LUN.

Added code to select "reservation_key" parameter value befor= e calling
PR handler during addition of new path to a new map.

Signed-off-by: ShivaKrishna Merla <shiva.krishna@nimblestorage.com&= gt;
---
 libmultipath/configure.c |    5 ++++-<= /div>
 multipathd/main.c        |    2 &#= 43;+
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/libmultipath/configure.c b/libmultipath/configure.c
index 24ad948..2071aa4 100644
--- a/libmultipath/configure.c
+++ b/libmultipath/configure.c
@@ -287,7 +287,10 @@ setup_map (struct multipath * mpp, char * par= ams, int params_size)
  select_gid(mpp);
  select_fast_io_fail(mpp);
  select_dev_loss(mpp);
- sele= ct_reservation_key(mpp);
+
+ = if (!mpp->reservation_key)
+ = select_reservation_key(mpp);
+
  select_retain_hwhandler(mpp);
  select_deferred_remove(mpp);
  select_delay_watch_checks(mpp);
diff --git a/multipathd/main.c b/multipathd/main.c
index 04f6d02..bf3423f 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -539,6 +539,8 @@ rescan:
  goto fail; /* leave path added to pathvec */
  }
 
+ = /* select configured reservation key */
+ = select_reservation_key(mpp);
  /* persistent reseravtion check*/
  mpath_pr_event_handle(pp);
--

--_000_D2EBB4B475AFShivaKrishnanimblestoragecom_-- --===============2994094700930614074== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============2994094700930614074==--