diff mbox

[1/2] lightnvm: warn if irqs are disabled in lock laddr

Message ID 1454322873-28687-1-git-send-email-javier@javigon.com (mailing list archive)
State New, archived
Headers show

Commit Message

=?UTF-8?q?Javier=20Gonz=C3=A1lez?= Feb. 1, 2016, 10:34 a.m. UTC
Add a warning if irqs are disabled when locking a new address in rrpc.
The typical path to a new request does not disable irqs, but this is not
guaranteed in the future.

Signed-off-by: Javier González <javier@cnexlabs.com>
---
 drivers/lightnvm/rrpc.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Matias Bjorling Feb. 3, 2016, 8:54 a.m. UTC | #1
On 02/01/2016 11:34 AM, Javier González wrote:
> Add a warning if irqs are disabled when locking a new address in rrpc.
> The typical path to a new request does not disable irqs, but this is not
> guaranteed in the future.
> 
> Signed-off-by: Javier González <javier@cnexlabs.com>
> ---
>  drivers/lightnvm/rrpc.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/lightnvm/rrpc.h b/drivers/lightnvm/rrpc.h
> index dfca5c4..c27283a 100644
> --- a/drivers/lightnvm/rrpc.h
> +++ b/drivers/lightnvm/rrpc.h
> @@ -184,6 +184,8 @@ static int __rrpc_lock_laddr(struct rrpc *rrpc, sector_t laddr,
>  	sector_t laddr_end = laddr + pages - 1;
>  	struct rrpc_inflight_rq *rtmp;
>  
> +	WARN_ON(irqs_disabled());
> +
>  	spin_lock_irq(&rrpc->inflights.lock);
>  	list_for_each_entry(rtmp, &rrpc->inflights.reqs, list) {
>  		if (unlikely(request_intersects(rtmp, laddr, laddr_end))) {
> 

Thanks, applied for next -rc.
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/lightnvm/rrpc.h b/drivers/lightnvm/rrpc.h
index dfca5c4..c27283a 100644
--- a/drivers/lightnvm/rrpc.h
+++ b/drivers/lightnvm/rrpc.h
@@ -184,6 +184,8 @@  static int __rrpc_lock_laddr(struct rrpc *rrpc, sector_t laddr,
 	sector_t laddr_end = laddr + pages - 1;
 	struct rrpc_inflight_rq *rtmp;
 
+	WARN_ON(irqs_disabled());
+
 	spin_lock_irq(&rrpc->inflights.lock);
 	list_for_each_entry(rtmp, &rrpc->inflights.reqs, list) {
 		if (unlikely(request_intersects(rtmp, laddr, laddr_end))) {