lightnvm: warn if irqs are disabled in lock laddr
authorJavier González <jg@lightnvm.io>
Thu, 4 Feb 2016 14:13:24 +0000 (15:13 +0100)
committerJens Axboe <axboe@fb.com>
Thu, 4 Feb 2016 16:19:45 +0000 (09:19 -0700)
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>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/lightnvm/rrpc.h

index ef13ac7700c80e352b8db97fed8c1e38ba504cc9..b0277cbf93d64d5a3e57f9c640bdd8377b9b711e 100644 (file)
@@ -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))) {