All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] zfcp: spin_lock_irqsave() is not nestable
@ 2016-10-13  8:53 ` Dan Carpenter
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2016-10-13  8:53 UTC (permalink / raw)
  To: Steffen Maier
  Cc: Martin Schwidefsky, Heiko Carstens, linux-s390, linux-kernel,
	kernel-janitors

We accidentally overwrite the original saved value of "flags" so that
we can't re-enable IRQs at the end of the function.  Presumably this
function is mostly called with IRQs disabled or it would be obvious in
testing.

Fixes: aceeffbb59bb ("zfcp: trace full payload of all SAN records (req,resp,iels)")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index 637cf89..5810019 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -384,7 +384,7 @@ void zfcp_dbf_san(char *tag, struct zfcp_dbf *dbf,
 	/* if (len > rec_len):
 	 * dump data up to cap_len ignoring small duplicate in rec->payload
 	 */
-	spin_lock_irqsave(&dbf->pay_lock, flags);
+	spin_lock(&dbf->pay_lock);
 	memset(payload, 0, sizeof(*payload));
 	memcpy(payload->area, paytag, ZFCP_DBF_TAG_LEN);
 	payload->fsf_req_id = req_id;

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

* [patch] zfcp: spin_lock_irqsave() is not nestable
@ 2016-10-13  8:53 ` Dan Carpenter
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2016-10-13  8:53 UTC (permalink / raw)
  To: Steffen Maier
  Cc: Martin Schwidefsky, Heiko Carstens, linux-s390, linux-kernel,
	kernel-janitors

We accidentally overwrite the original saved value of "flags" so that
we can't re-enable IRQs at the end of the function.  Presumably this
function is mostly called with IRQs disabled or it would be obvious in
testing.

Fixes: aceeffbb59bb ("zfcp: trace full payload of all SAN records (req,resp,iels)")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index 637cf89..5810019 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -384,7 +384,7 @@ void zfcp_dbf_san(char *tag, struct zfcp_dbf *dbf,
 	/* if (len > rec_len):
 	 * dump data up to cap_len ignoring small duplicate in rec->payload
 	 */
-	spin_lock_irqsave(&dbf->pay_lock, flags);
+	spin_lock(&dbf->pay_lock);
 	memset(payload, 0, sizeof(*payload));
 	memcpy(payload->area, paytag, ZFCP_DBF_TAG_LEN);
 	payload->fsf_req_id = req_id;

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

* Re: [patch] zfcp: spin_lock_irqsave() is not nestable
  2016-10-13  8:53 ` Dan Carpenter
@ 2016-10-13 10:49   ` Steffen Maier
  -1 siblings, 0 replies; 12+ messages in thread
From: Steffen Maier @ 2016-10-13 10:49 UTC (permalink / raw)
  To: Dan Carpenter, linux-scsi, James E . J . Bottomley, Martin K . Petersen
  Cc: Martin Schwidefsky, Heiko Carstens, linux-s390, linux-kernel,
	kernel-janitors, Hendrik Brückner, Gerald Schaefer

Dan, many thanks for catching this! Sparse did not notice, is there 
other tooling that would find such things?

James, Martin, could you please queue this as fix for one of my patches 
that went into the 4.9 merge window, so for 4.9-rc I guess?
https://lkml.kernel.org/r/20161013085358.GH16198@mwanda
or
https://lkml.org/lkml/2016/10/13/94

On 10/13/2016 10:53 AM, Dan Carpenter wrote:
> We accidentally overwrite the original saved value of "flags" so that
> we can't re-enable IRQs at the end of the function.  Presumably this
> function is mostly called with IRQs disabled or it would be obvious in
> testing.
>
> Fixes: aceeffbb59bb ("zfcp: trace full payload of all SAN records (req,resp,iels)")

Cc: <stable@vger.kernel.org> #2.6.38+

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>

>
> diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
> index 637cf89..5810019 100644
> --- a/drivers/s390/scsi/zfcp_dbf.c
> +++ b/drivers/s390/scsi/zfcp_dbf.c
> @@ -384,7 +384,7 @@ void zfcp_dbf_san(char *tag, struct zfcp_dbf *dbf,
>  	/* if (len > rec_len):
>  	 * dump data up to cap_len ignoring small duplicate in rec->payload
>  	 */
> -	spin_lock_irqsave(&dbf->pay_lock, flags);
> +	spin_lock(&dbf->pay_lock);
>  	memset(payload, 0, sizeof(*payload));
>  	memcpy(payload->area, paytag, ZFCP_DBF_TAG_LEN);
>  	payload->fsf_req_id = req_id;
>

-- 
Mit freundlichen Grüßen / Kind regards
Steffen Maier

Linux on z Systems Development

IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

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

* Re: [patch] zfcp: spin_lock_irqsave() is not nestable
@ 2016-10-13 10:49   ` Steffen Maier
  0 siblings, 0 replies; 12+ messages in thread
From: Steffen Maier @ 2016-10-13 10:49 UTC (permalink / raw)
  To: Dan Carpenter, linux-scsi, James E . J . Bottomley, Martin K . Petersen
  Cc: Martin Schwidefsky, Heiko Carstens, linux-s390, linux-kernel,
	kernel-janitors, Hendrik Brückner, Gerald Schaefer

Dan, many thanks for catching this! Sparse did not notice, is there 
other tooling that would find such things?

James, Martin, could you please queue this as fix for one of my patches 
that went into the 4.9 merge window, so for 4.9-rc I guess?
https://lkml.kernel.org/r/20161013085358.GH16198@mwanda
or
https://lkml.org/lkml/2016/10/13/94

On 10/13/2016 10:53 AM, Dan Carpenter wrote:
> We accidentally overwrite the original saved value of "flags" so that
> we can't re-enable IRQs at the end of the function.  Presumably this
> function is mostly called with IRQs disabled or it would be obvious in
> testing.
>
> Fixes: aceeffbb59bb ("zfcp: trace full payload of all SAN records (req,resp,iels)")

Cc: <stable@vger.kernel.org> #2.6.38+

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>

>
> diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
> index 637cf89..5810019 100644
> --- a/drivers/s390/scsi/zfcp_dbf.c
> +++ b/drivers/s390/scsi/zfcp_dbf.c
> @@ -384,7 +384,7 @@ void zfcp_dbf_san(char *tag, struct zfcp_dbf *dbf,
>  	/* if (len > rec_len):
>  	 * dump data up to cap_len ignoring small duplicate in rec->payload
>  	 */
> -	spin_lock_irqsave(&dbf->pay_lock, flags);
> +	spin_lock(&dbf->pay_lock);
>  	memset(payload, 0, sizeof(*payload));
>  	memcpy(payload->area, paytag, ZFCP_DBF_TAG_LEN);
>  	payload->fsf_req_id = req_id;
>

-- 
Mit freundlichen Grüßen / Kind regards
Steffen Maier

Linux on z Systems Development

IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [patch] zfcp: spin_lock_irqsave() is not nestable
  2016-10-13 10:49   ` Steffen Maier
@ 2016-10-13 11:27     ` Dan Carpenter
  -1 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2016-10-13 11:27 UTC (permalink / raw)
  To: Steffen Maier
  Cc: linux-scsi, James E . J . Bottomley, Martin K . Petersen,
	Martin Schwidefsky, Heiko Carstens, linux-s390, linux-kernel,
	kernel-janitors, Hendrik Brückner, Gerald Schaefer

On Thu, Oct 13, 2016 at 12:49:18PM +0200, Steffen Maier wrote:
> Dan, many thanks for catching this! Sparse did not notice, is there
> other tooling that would find such things?

This was a Smatch warning.

regards,
dan carpenter

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

* Re: [patch] zfcp: spin_lock_irqsave() is not nestable
@ 2016-10-13 11:27     ` Dan Carpenter
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2016-10-13 11:27 UTC (permalink / raw)
  To: Steffen Maier
  Cc: linux-scsi, James E . J . Bottomley, Martin K . Petersen,
	Martin Schwidefsky, Heiko Carstens, linux-s390, linux-kernel,
	kernel-janitors, Hendrik Brückner, Gerald Schaefer

On Thu, Oct 13, 2016 at 12:49:18PM +0200, Steffen Maier wrote:
> Dan, many thanks for catching this! Sparse did not notice, is there
> other tooling that would find such things?

This was a Smatch warning.

regards,
dan carpenter


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

* Re: [patch] zfcp: spin_lock_irqsave() is not nestable
  2016-10-13 10:49   ` Steffen Maier
@ 2016-10-14 20:21     ` Martin K. Petersen
  -1 siblings, 0 replies; 12+ messages in thread
From: Martin K. Petersen @ 2016-10-14 20:21 UTC (permalink / raw)
  To: Steffen Maier
  Cc: Dan Carpenter, linux-scsi, James E . J . Bottomley,
	Martin K . Petersen, Martin Schwidefsky, Heiko Carstens,
	linux-s390, linux-kernel, kernel-janitors, Hendrik Brückner,
	Gerald Schaefer

>>>>> "Steffen" == Steffen Maier <maier@linux.vnet.ibm.com> writes:

Steffen> could you please queue this as fix for one of my patches that
Steffen> went into the 4.9 merge window, so for 4.9-rc I guess?

Applied to 4.9/scsi-fixes.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [patch] zfcp: spin_lock_irqsave() is not nestable
@ 2016-10-14 20:21     ` Martin K. Petersen
  0 siblings, 0 replies; 12+ messages in thread
From: Martin K. Petersen @ 2016-10-14 20:21 UTC (permalink / raw)
  To: Steffen Maier
  Cc: Dan Carpenter, linux-scsi, James E . J . Bottomley,
	Martin K . Petersen, Martin Schwidefsky, Heiko Carstens,
	linux-s390, linux-kernel, kernel-janitors, Hendrik Brückner,
	Gerald Schaefer

>>>>> "Steffen" = Steffen Maier <maier@linux.vnet.ibm.com> writes:

Steffen> could you please queue this as fix for one of my patches that
Steffen> went into the 4.9 merge window, so for 4.9-rc I guess?

Applied to 4.9/scsi-fixes.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [patch] zfcp: spin_lock_irqsave() is not nestable
  2016-10-14 20:21     ` Martin K. Petersen
@ 2016-10-24  8:18       ` Christian Borntraeger
  -1 siblings, 0 replies; 12+ messages in thread
From: Christian Borntraeger @ 2016-10-24  8:18 UTC (permalink / raw)
  To: Martin K. Petersen, Steffen Maier
  Cc: Dan Carpenter, linux-scsi, James E . J . Bottomley,
	Martin Schwidefsky, Heiko Carstens, linux-s390, linux-kernel,
	kernel-janitors, Hendrik Brückner, Gerald Schaefer

On 10/14/2016 10:21 PM, Martin K. Petersen wrote:
>>>>>> "Steffen" == Steffen Maier <maier@linux.vnet.ibm.com> writes:
> 
> Steffen> could you please queue this as fix for one of my patches that
> Steffen> went into the 4.9 merge window, so for 4.9-rc I guess?
> 
> Applied to 4.9/scsi-fixes.
> 

FWIW, I do see rcu stall errors with 4.9-rc1 from time to time, so I assume
that this fix is not only theoretical but fixes a real life issue.

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

* Re: [patch] zfcp: spin_lock_irqsave() is not nestable
@ 2016-10-24  8:18       ` Christian Borntraeger
  0 siblings, 0 replies; 12+ messages in thread
From: Christian Borntraeger @ 2016-10-24  8:18 UTC (permalink / raw)
  To: Martin K. Petersen, Steffen Maier
  Cc: Dan Carpenter, linux-scsi, James E . J . Bottomley,
	Martin Schwidefsky, Heiko Carstens, linux-s390, linux-kernel,
	kernel-janitors, Hendrik Brückner, Gerald Schaefer

On 10/14/2016 10:21 PM, Martin K. Petersen wrote:
>>>>>> "Steffen" = Steffen Maier <maier@linux.vnet.ibm.com> writes:
> 
> Steffen> could you please queue this as fix for one of my patches that
> Steffen> went into the 4.9 merge window, so for 4.9-rc I guess?
> 
> Applied to 4.9/scsi-fixes.
> 

FWIW, I do see rcu stall errors with 4.9-rc1 from time to time, so I assume
that this fix is not only theoretical but fixes a real life issue.


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

* Re: [patch] zfcp: spin_lock_irqsave() is not nestable
  2016-10-24  8:18       ` Christian Borntraeger
@ 2016-10-25  7:28         ` Christian Borntraeger
  -1 siblings, 0 replies; 12+ messages in thread
From: Christian Borntraeger @ 2016-10-25  7:28 UTC (permalink / raw)
  To: Martin K. Petersen, Steffen Maier
  Cc: Dan Carpenter, linux-scsi, James E . J . Bottomley,
	Martin Schwidefsky, Heiko Carstens, linux-s390, linux-kernel,
	kernel-janitors, Hendrik Brückner, Gerald Schaefer

On 10/24/2016 10:18 AM, Christian Borntraeger wrote:
> On 10/14/2016 10:21 PM, Martin K. Petersen wrote:
>>>>>>> "Steffen" == Steffen Maier <maier@linux.vnet.ibm.com> writes:
>>
>> Steffen> could you please queue this as fix for one of my patches that
>> Steffen> went into the 4.9 merge window, so for 4.9-rc I guess?
>>
>> Applied to 4.9/scsi-fixes.
>>
> 
> FWIW, I do see rcu stall errors with 4.9-rc1 from time to time, so I assume
> that this fix is not only theoretical but fixes a real life issue.

Yes, with that patch the rcu stalls are gone, I assume its already on a branch
that does not rebase, otherwise feel free to add

Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>

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

* Re: [patch] zfcp: spin_lock_irqsave() is not nestable
@ 2016-10-25  7:28         ` Christian Borntraeger
  0 siblings, 0 replies; 12+ messages in thread
From: Christian Borntraeger @ 2016-10-25  7:28 UTC (permalink / raw)
  To: Martin K. Petersen, Steffen Maier
  Cc: Dan Carpenter, linux-scsi, James E . J . Bottomley,
	Martin Schwidefsky, Heiko Carstens, linux-s390, linux-kernel,
	kernel-janitors, Hendrik Brückner, Gerald Schaefer

On 10/24/2016 10:18 AM, Christian Borntraeger wrote:
> On 10/14/2016 10:21 PM, Martin K. Petersen wrote:
>>>>>>> "Steffen" = Steffen Maier <maier@linux.vnet.ibm.com> writes:
>>
>> Steffen> could you please queue this as fix for one of my patches that
>> Steffen> went into the 4.9 merge window, so for 4.9-rc I guess?
>>
>> Applied to 4.9/scsi-fixes.
>>
> 
> FWIW, I do see rcu stall errors with 4.9-rc1 from time to time, so I assume
> that this fix is not only theoretical but fixes a real life issue.

Yes, with that patch the rcu stalls are gone, I assume its already on a branch
that does not rebase, otherwise feel free to add

Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>


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

end of thread, other threads:[~2016-10-25  7:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-13  8:53 [patch] zfcp: spin_lock_irqsave() is not nestable Dan Carpenter
2016-10-13  8:53 ` Dan Carpenter
2016-10-13 10:49 ` Steffen Maier
2016-10-13 10:49   ` Steffen Maier
2016-10-13 11:27   ` Dan Carpenter
2016-10-13 11:27     ` Dan Carpenter
2016-10-14 20:21   ` Martin K. Petersen
2016-10-14 20:21     ` Martin K. Petersen
2016-10-24  8:18     ` Christian Borntraeger
2016-10-24  8:18       ` Christian Borntraeger
2016-10-25  7:28       ` Christian Borntraeger
2016-10-25  7:28         ` Christian Borntraeger

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.