linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	alan@lxorguk.ukuu.org.uk,
	Peter Oberparleiter <peter.oberparleiter@de.ibm.com>,
	Sebastian Ott <sebott@linux.vnet.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [ 03/71] s390/cio: fix pgid reserved check
Date: Tue, 15 Jan 2013 14:54:00 -0800	[thread overview]
Message-ID: <20130115225340.634562767@linuxfoundation.org> (raw)
In-Reply-To: <20130115225340.367496998@linuxfoundation.org>

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sebastian Ott <sebott@linux.vnet.ibm.com>

commit d99e79ec5574fc556c988f613ed6175f6de66f4a upstream.

The check to whom a device is reserved is done by checking the path
state of the affected channel paths. If it turns out that one path is
flagged as reserved by someone else the whole device is marked as such.

However the meaning of the RESVD_ELSE bit is that the addressed device
is reserved to a different pathgroup (and not reserved to a different
LPAR). If we do this test on a path which is currently not a member of
the pathgroup we could erroneously mark the device as reserved to
someone else.

To fix this collect the reserved state for all potential members of the
pathgroup and only mark the device as reserved if all of those potential
members have the RESVD_ELSE bit set.

Acked-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/s390/cio/device_pgid.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/drivers/s390/cio/device_pgid.c
+++ b/drivers/s390/cio/device_pgid.c
@@ -234,7 +234,7 @@ static int pgid_cmp(struct pgid *p1, str
  * Determine pathgroup state from PGID data.
  */
 static void pgid_analyze(struct ccw_device *cdev, struct pgid **p,
-			 int *mismatch, int *reserved, u8 *reset)
+			 int *mismatch, u8 *reserved, u8 *reset)
 {
 	struct pgid *pgid = &cdev->private->pgid[0];
 	struct pgid *first = NULL;
@@ -248,7 +248,7 @@ static void pgid_analyze(struct ccw_devi
 		if ((cdev->private->pgid_valid_mask & lpm) == 0)
 			continue;
 		if (pgid->inf.ps.state2 == SNID_STATE2_RESVD_ELSE)
-			*reserved = 1;
+			*reserved |= lpm;
 		if (pgid_is_reset(pgid)) {
 			*reset |= lpm;
 			continue;
@@ -316,14 +316,14 @@ static void snid_done(struct ccw_device
 	struct subchannel *sch = to_subchannel(cdev->dev.parent);
 	struct pgid *pgid;
 	int mismatch = 0;
-	int reserved = 0;
+	u8 reserved = 0;
 	u8 reset = 0;
 	u8 donepm;
 
 	if (rc)
 		goto out;
 	pgid_analyze(cdev, &pgid, &mismatch, &reserved, &reset);
-	if (reserved)
+	if (reserved == cdev->private->pgid_valid_mask)
 		rc = -EUSERS;
 	else if (mismatch)
 		rc = -EOPNOTSUPP;
@@ -336,7 +336,7 @@ static void snid_done(struct ccw_device
 	}
 out:
 	CIO_MSG_EVENT(2, "snid: device 0.%x.%04x: rc=%d pvm=%02x vpm=%02x "
-		      "todo=%02x mism=%d rsvd=%d reset=%02x\n", id->ssid,
+		      "todo=%02x mism=%d rsvd=%02x reset=%02x\n", id->ssid,
 		      id->devno, rc, cdev->private->pgid_valid_mask, sch->vpm,
 		      cdev->private->pgid_todo_mask, mismatch, reserved, reset);
 	switch (rc) {



  parent reply	other threads:[~2013-01-15 22:54 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-15 22:53 [ 00/71] 3.0.59-stable review Greg Kroah-Hartman
2013-01-15 22:53 ` [ 01/71] powerpc: Fix CONFIG_RELOCATABLE=y CONFIG_CRASH_DUMP=n build Greg Kroah-Hartman
2013-01-15 22:53 ` [ 02/71] powerpc/vdso: Remove redundant locking in update_vsyscall_tz() Greg Kroah-Hartman
2013-01-15 22:54 ` Greg Kroah-Hartman [this message]
2013-01-15 22:54 ` [ 04/71] mm: compaction: fix echo 1 > compact_memory return error issue Greg Kroah-Hartman
2013-01-15 22:54 ` [ 05/71] mm: use aligned zone start for pfn_to_bitidx calculation Greg Kroah-Hartman
2013-01-15 22:54 ` [ 06/71] Revert "ath9k_hw: Update AR9003 high_power tx gain table" Greg Kroah-Hartman
2013-01-15 22:54 ` [ 07/71] ath9k: ar9003: fix OTP register offsets for AR9340 Greg Kroah-Hartman
2013-01-15 22:54 ` [ 08/71] firewire: net: Fix handling of fragmented multicast/broadcast packets Greg Kroah-Hartman
2013-01-15 22:54 ` [ 09/71] SCSI: mvsas: fix undefined bit shift Greg Kroah-Hartman
2013-01-15 22:54 ` [ 10/71] SCSI: qla2xxx: Test and clear FCPORT_UPDATE_NEEDED atomically Greg Kroah-Hartman
2013-01-15 22:54 ` [ 11/71] sata_promise: fix hardreset lockdep error Greg Kroah-Hartman
2013-01-15 22:54 ` [ 12/71] libata: set dma_mode to 0xff in reset Greg Kroah-Hartman
2013-01-15 22:54 ` [ 13/71] libata: fix Null pointer dereference on disk error Greg Kroah-Hartman
2013-01-15 22:54 ` [ 14/71] target/tcm_fc: fix the lockdep warning due to inconsistent lock state Greg Kroah-Hartman
2013-01-15 22:54 ` [ 15/71] mfd: Only unregister platform devices allocated by the mfd core Greg Kroah-Hartman
2013-01-15 22:54 ` [ 16/71] ext4: fix memory leak in ext4_xattr_set_acl()s error path Greg Kroah-Hartman
2013-01-15 22:54 ` [ 17/71] SUNRPC: Ensure that we free the rpc_task after cleanups are done Greg Kroah-Hartman
2013-01-15 22:54 ` [ 18/71] SUNRPC: Ensure we release the socket write lock if the rpc_task exits early Greg Kroah-Hartman
2013-01-17 15:14   ` Herton Ronaldo Krzesinski
2013-01-17 16:03     ` Greg Kroah-Hartman
2013-01-15 22:54 ` [ 19/71] jffs2: hold erase_completion_lock on exit Greg Kroah-Hartman
2013-01-15 22:54 ` [ 20/71] i2400m: add Intel 6150 device IDs Greg Kroah-Hartman
2013-01-15 22:54 ` [ 21/71] drm/i915: make the panel fitter work on pipes B and C on IVB Greg Kroah-Hartman
2013-01-15 22:54 ` [ 22/71] RDMA/nes: Fix for crash when registering zero length MR for CQ Greg Kroah-Hartman
2013-01-15 22:54 ` [ 23/71] RDMA/nes: Fix for terminate timer crash Greg Kroah-Hartman
2013-01-15 22:54 ` [ 24/71] ring-buffer: Fix race between integrity check and readers Greg Kroah-Hartman
2013-01-17 20:02   ` Herton Ronaldo Krzesinski
2013-01-15 22:54 ` [ 25/71] dm ioctl: prevent unsafe change to dm_ioctl data_size Greg Kroah-Hartman
2013-01-15 22:54 ` [ 26/71] staging: vt6656: [BUG] out of bound array reference in RFbSetPower Greg Kroah-Hartman
2013-01-15 22:54 ` [ 27/71] staging: vt6656: 64 bit fixes: use u32 for QWORD definition Greg Kroah-Hartman
2013-01-15 22:54 ` [ 28/71] staging: vt6656: 64 bit fixes : correct all type sizes Greg Kroah-Hartman
2013-01-15 22:54 ` [ 29/71] staging: vt6656: 64 bit fixes: fix long warning messages Greg Kroah-Hartman
2013-01-15 22:54 ` [ 30/71] staging: vt6656: 64bit fixes: key.c/h change unsigned long to u32 Greg Kroah-Hartman
2013-01-15 22:54 ` [ 31/71] staging: vt6656: 64bit fixes: vCommandTimerWait change calculation of timer Greg Kroah-Hartman
2013-01-15 22:54 ` [ 32/71] video: mxsfb: fix crash when unblanking the display Greg Kroah-Hartman
2013-01-15 22:54 ` [ 33/71] ext4: fix extent tree corruption caused by hole punch Greg Kroah-Hartman
2013-01-15 22:54 ` [ 34/71] jbd2: fix assertion failure in jbd2_journal_flush() Greg Kroah-Hartman
2013-01-15 22:54 ` [ 35/71] ext4: do not try to write superblock on ro remount w/o journal Greg Kroah-Hartman
2013-01-15 22:54 ` [ 36/71] ext4: lock i_mutex when truncating orphan inodes Greg Kroah-Hartman
2013-01-17 20:07   ` Herton Ronaldo Krzesinski
2013-01-18  0:46     ` Greg Kroah-Hartman
2013-01-18  3:47       ` Herton Ronaldo Krzesinski
2013-01-18  3:56         ` Theodore Ts'o
2013-01-18 21:27           ` Greg Kroah-Hartman
2013-01-15 22:54 ` [ 37/71] aoe: do not call bdi_init after blk_alloc_queue Greg Kroah-Hartman
2013-01-15 22:54 ` [ 38/71] udf: fix memory leak while allocating blocks during write Greg Kroah-Hartman
2013-01-15 22:54 ` [ 39/71] udf: dont increment lenExtents while writing to a hole Greg Kroah-Hartman
2013-01-15 22:54 ` [ 40/71] thp, memcg: split hugepage for memcg oom on cow Greg Kroah-Hartman
2013-01-15 22:54 ` [ 41/71] x86, amd: Disable way access filter on Piledriver CPUs Greg Kroah-Hartman
2013-01-15 22:54 ` [ 42/71] ACPI : do not use Lid and Sleep button for S5 wakeup Greg Kroah-Hartman
2013-01-15 22:54 ` [ 43/71] rtnetlink: Compute and store minimum ifinfo dump size Greg Kroah-Hartman
2013-01-15 22:54 ` [ 44/71] rtnetlink: Fix problem with buffer allocation Greg Kroah-Hartman
2013-01-15 22:54 ` [ 45/71] rtnetlink: fix rtnl_calcit() and rtnl_dump_ifinfo() Greg Kroah-Hartman
2013-01-15 22:54 ` [ 46/71] epoll: prevent missed events on EPOLL_CTL_MOD Greg Kroah-Hartman
2013-01-15 22:54 ` [ 47/71] ASoC: wm2000: Fix sense of speech clarity enable Greg Kroah-Hartman
2013-01-15 22:54 ` [ 48/71] ALSA: pxa27x: fix ac97 cold reset Greg Kroah-Hartman
2013-01-15 22:54 ` [ 49/71] staging: comedi: prevent auto-unconfig of manually configured devices Greg Kroah-Hartman
2013-01-15 22:54 ` [ 50/71] staging: comedi: comedi_test: fix race when cancelling command Greg Kroah-Hartman
2013-01-15 22:54 ` [ 51/71] staging: r8712u: Add new device ID Greg Kroah-Hartman
2013-01-15 22:54 ` [ 52/71] staging: speakup: avoid out-of-range access in synth_init() Greg Kroah-Hartman
2013-01-15 22:54 ` [ 53/71] staging: speakup: avoid out-of-range access in synth_add() Greg Kroah-Hartman
2013-01-15 22:54 ` [ 54/71] radeon/kms: force rn50 chip to always report connected on analog output Greg Kroah-Hartman
2013-01-15 22:54 ` [ 55/71] mac80211: use del_timer_sync for final sta cleanup timer deletion Greg Kroah-Hartman
2013-01-15 22:54 ` [ 56/71] USB: option: add Nexpring NP10T terminal id Greg Kroah-Hartman
2013-01-15 22:54 ` [ 57/71] USB: option: blacklist network interface on ZTE MF880 Greg Kroah-Hartman
2013-01-15 22:54 ` [ 58/71] USB: option: Add new MEDIATEK PID support Greg Kroah-Hartman
2013-01-15 22:54 ` [ 59/71] USB: option: add Telekom Speedstick LTE II Greg Kroah-Hartman
2013-01-15 22:54 ` [ 60/71] usb: ftdi_sio: Crucible Technologies COMET Caller ID - pid added Greg Kroah-Hartman
2013-01-15 22:54 ` [ 61/71] USB: cdc-acm: Add support for "PSC Scanning, Magellan 800i" Greg Kroah-Hartman
2013-01-15 22:54 ` [ 62/71] usb: gadget: dummy: fix enumeration with g_multi Greg Kroah-Hartman
2013-01-15 22:55 ` [ 63/71] USB: Increase reset timeout Greg Kroah-Hartman
2013-01-15 22:55 ` [ 64/71] USB: hub: handle claim of enabled remote wakeup after reset Greg Kroah-Hartman
2013-01-15 22:55 ` [ 65/71] xhci: Handle HS bulk/ctrl endpoints that dont NAK Greg Kroah-Hartman
2013-01-15 22:55 ` [ 66/71] GFS2: Test bufdata with buffer locked and gfs2_log_lock held Greg Kroah-Hartman
2013-01-15 22:55 ` [ 67/71] intel-iommu: Free old page tables before creating superpage Greg Kroah-Hartman
2013-01-15 22:55 ` [ 68/71] KVM: PPC: 44x: fix DCR read/write Greg Kroah-Hartman
2013-01-15 22:55 ` [ 69/71] Revert "drm/i915: no lvds quirk for Zotac ZDBOX SD ID12/ID13" Greg Kroah-Hartman
2013-01-15 22:55 ` [ 70/71] staging: comedi: dont hijack hardware device private data Greg Kroah-Hartman
2013-01-15 22:55 ` [ 71/71] staging: comedi: Kconfig: COMEDI_NI_AT_A2150 should select COMEDI_FC Greg Kroah-Hartman
2013-01-15 23:49 ` [ 00/71] 3.0.59-stable review Peter Senna Tschudin
2013-01-16  0:06   ` Greg Kroah-Hartman
2013-01-16  3:47 ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130115225340.634562767@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.oberparleiter@de.ibm.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=sebott@linux.vnet.ibm.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).