All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] sending DASD patches through linux-block
@ 2019-08-01 11:06 Stefan Haberland
  2019-08-01 11:06 ` [PATCH 1/1] s390/dasd: fix endless loop after read unit address configuration Stefan Haberland
  2019-08-02  2:47 ` [PATCH 0/1] sending DASD patches through linux-block Jens Axboe
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Haberland @ 2019-08-01 11:06 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-s390, hoeppner, heiko.carstens, borntraeger, gor

Hi Jens,

we would like to get our DASD related patches upstream through your
linux-block git tree in the future.
We hope to get a better integration and that we are able to identify
potential conflicts with generic blocklayer changes earlier.

I hope this is OK for you. I have attached a first patch that fixes a
bug in the DASD driver. This patch is based on the master branch of your
linux-block git tree.

Please let me know if I should change something in my workflow.

Kind regards,
Stefan

Stefan Haberland (1):
  s390/dasd: fix endless loop after read unit address configuration

 drivers/s390/block/dasd_alias.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1] s390/dasd: fix endless loop after read unit address configuration
  2019-08-01 11:06 [PATCH 0/1] sending DASD patches through linux-block Stefan Haberland
@ 2019-08-01 11:06 ` Stefan Haberland
  2019-08-02  2:47   ` Jens Axboe
  2019-08-02  2:47 ` [PATCH 0/1] sending DASD patches through linux-block Jens Axboe
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Haberland @ 2019-08-01 11:06 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-s390, hoeppner, heiko.carstens, borntraeger, gor

After getting a storage server event that causes the DASD device driver
to update its unit address configuration during a device shutdown there is
the possibility of an endless loop in the device driver.

In the system log there will be ongoing DASD error messages with RC: -19.

The reason is that the loop starting the ruac request only terminates when
the retry counter is decreased to 0. But in the sleep_on function there are
early exit paths that do not decrease the retry counter.

Prevent an endless loop by handling those cases separately.

Remove the unnecessary do..while loop since the sleep_on function takes
care of retries by itself.

Fixes: 8e09f21574ea ("[S390] dasd: add hyper PAV support to DASD device driver, part 1")
Cc: stable@vger.kernel.org # 2.6.25+
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>

---
 drivers/s390/block/dasd_alias.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/s390/block/dasd_alias.c b/drivers/s390/block/dasd_alias.c
index b9ce93e9df89..99f86612f775 100644
--- a/drivers/s390/block/dasd_alias.c
+++ b/drivers/s390/block/dasd_alias.c
@@ -383,6 +383,20 @@ suborder_not_supported(struct dasd_ccw_req *cqr)
 	char msg_format;
 	char msg_no;
 
+	/*
+	 * intrc values ENODEV, ENOLINK and EPERM
+	 * will be optained from sleep_on to indicate that no
+	 * IO operation can be started
+	 */
+	if (cqr->intrc == -ENODEV)
+		return 1;
+
+	if (cqr->intrc == -ENOLINK)
+		return 1;
+
+	if (cqr->intrc == -EPERM)
+		return 1;
+
 	sense = dasd_get_sense(&cqr->irb);
 	if (!sense)
 		return 0;
@@ -447,12 +461,8 @@ static int read_unit_address_configuration(struct dasd_device *device,
 	lcu->flags &= ~NEED_UAC_UPDATE;
 	spin_unlock_irqrestore(&lcu->lock, flags);
 
-	do {
-		rc = dasd_sleep_on(cqr);
-		if (rc && suborder_not_supported(cqr))
-			return -EOPNOTSUPP;
-	} while (rc && (cqr->retries > 0));
-	if (rc) {
+	rc = dasd_sleep_on(cqr);
+	if (rc && !suborder_not_supported(cqr)) {
 		spin_lock_irqsave(&lcu->lock, flags);
 		lcu->flags |= NEED_UAC_UPDATE;
 		spin_unlock_irqrestore(&lcu->lock, flags);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/1] sending DASD patches through linux-block
  2019-08-01 11:06 [PATCH 0/1] sending DASD patches through linux-block Stefan Haberland
  2019-08-01 11:06 ` [PATCH 1/1] s390/dasd: fix endless loop after read unit address configuration Stefan Haberland
@ 2019-08-02  2:47 ` Jens Axboe
  1 sibling, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2019-08-02  2:47 UTC (permalink / raw)
  To: Stefan Haberland
  Cc: linux-block, linux-s390, hoeppner, heiko.carstens, borntraeger, gor

On 8/1/19 5:06 AM, Stefan Haberland wrote:
> Hi Jens,
> 
> we would like to get our DASD related patches upstream through your
> linux-block git tree in the future.
> We hope to get a better integration and that we are able to identify
> potential conflicts with generic blocklayer changes earlier.
> 
> I hope this is OK for you. I have attached a first patch that fixes a
> bug in the DASD driver. This patch is based on the master branch of your
> linux-block git tree.

Certainly. No extra hassle for me, and if it makes it easier for you,
then by all means.

> Please let me know if I should change something in my workflow.

Looks fine to me, I generally prefer patches (individual or series)
to git trees, unless it's a huge series.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] s390/dasd: fix endless loop after read unit address configuration
  2019-08-01 11:06 ` [PATCH 1/1] s390/dasd: fix endless loop after read unit address configuration Stefan Haberland
@ 2019-08-02  2:47   ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2019-08-02  2:47 UTC (permalink / raw)
  To: Stefan Haberland
  Cc: linux-block, linux-s390, hoeppner, heiko.carstens, borntraeger, gor

On 8/1/19 5:06 AM, Stefan Haberland wrote:
> After getting a storage server event that causes the DASD device driver
> to update its unit address configuration during a device shutdown there is
> the possibility of an endless loop in the device driver.
> 
> In the system log there will be ongoing DASD error messages with RC: -19.
> 
> The reason is that the loop starting the ruac request only terminates when
> the retry counter is decreased to 0. But in the sleep_on function there are
> early exit paths that do not decrease the retry counter.
> 
> Prevent an endless loop by handling those cases separately.
> 
> Remove the unnecessary do..while loop since the sleep_on function takes
> care of retries by itself.

Applied for 5.3, thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-02  2:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-01 11:06 [PATCH 0/1] sending DASD patches through linux-block Stefan Haberland
2019-08-01 11:06 ` [PATCH 1/1] s390/dasd: fix endless loop after read unit address configuration Stefan Haberland
2019-08-02  2:47   ` Jens Axboe
2019-08-02  2:47 ` [PATCH 0/1] sending DASD patches through linux-block Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.