Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1327675

[PATCH 1/2] xen/scsiback: correct frontend counting

From Juergen Gross <jgross@suse.com>
Newsgroups linux.kernel
Subject [PATCH 1/2] xen/scsiback: correct frontend counting
Date 2016-02-05 14:30 +0100
Message-ID <qYOCu-Lw-9@gated-at.bofh.it> (permalink)
References <qYOsO-I2-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


When adding a new frontend to xen-scsiback don't decrement the number
of active frontends in case of no error. Not doing so results in a
failure when trying to remove the xen-pvscsi nexus even if no domain
is using it.

Signed-off-by: Juergen Gross <jgross@suse.com>
Cc: stable@vger.kernel.org
---
 drivers/xen/xen-scsiback.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
index ad4eb10..51387d7 100644
--- a/drivers/xen/xen-scsiback.c
+++ b/drivers/xen/xen-scsiback.c
@@ -939,12 +939,12 @@ out:
 	spin_unlock_irqrestore(&info->v2p_lock, flags);
 
 out_free:
-	mutex_lock(&tpg->tv_tpg_mutex);
-	tpg->tv_tpg_fe_count--;
-	mutex_unlock(&tpg->tv_tpg_mutex);
-
-	if (err)
+	if (err) {
+		mutex_lock(&tpg->tv_tpg_mutex);
+		tpg->tv_tpg_fe_count--;
+		mutex_unlock(&tpg->tv_tpg_mutex);
 		kfree(new);
+	}
 
 	return err;
 }
-- 
2.6.2

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] xen/scsiback: correct two issues Juergen Gross <jgross@suse.com> - 2016-02-05 14:20 +0100
  [PATCH 2/2] xen/scsiback: avoid warnings when adding multiple LUNs to a domain Juergen Gross <jgross@suse.com> - 2016-02-05 14:30 +0100
    Re: [PATCH 2/2] xen/scsiback: avoid warnings when adding multiple  LUNs to a domain Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-05 17:00 +0100
      Re: [PATCH 2/2] xen/scsiback: avoid warnings when adding multiple  LUNs to a domain Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-05 17:00 +0100
      Re: [PATCH 2/2] xen/scsiback: avoid warnings when adding multiple  LUNs to a domain Juergen Gross <jgross@suse.com> - 2016-02-05 18:10 +0100
        Re: [PATCH 2/2] xen/scsiback: avoid warnings when adding multiple  LUNs to a domain Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-05 18:30 +0100
          Re: [PATCH 2/2] xen/scsiback: avoid warnings when adding multiple  LUNs to a domain Juergen Gross <jgross@suse.com> - 2016-02-08 13:30 +0100
  [PATCH 1/2] xen/scsiback: correct frontend counting Juergen Gross <jgross@suse.com> - 2016-02-05 14:30 +0100
    Re: [PATCH 1/2] xen/scsiback: correct frontend counting Juergen Gross <jgross@suse.com> - 2016-02-05 16:50 +0100
    Re: [PATCH 1/2] xen/scsiback: correct frontend counting Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-05 16:50 +0100

csiph-web