Skip to content

Commit 7def52b

Browse files
committed
dm integrity: fix to not disable/enable interrupts from interrupt context
Use spin_lock_irqsave and spin_unlock_irqrestore rather than spin_{lock,unlock}_irq in submit_flush_bio(). Otherwise lockdep issues the following warning: DEBUG_LOCKS_WARN_ON(current->hardirq_context) WARNING: CPU: 1 PID: 0 at kernel/locking/lockdep.c:2748 trace_hardirqs_on_caller+0x107/0x180 Reported-by: Ondrej Kozina <okozina@redhat.com> Tested-by: Ondrej Kozina <okozina@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Acked-by: Mikulas Patocka <mpatocka@redhat.com>
1 parent cd15fb6 commit 7def52b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/md/dm-integrity.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,10 +1105,13 @@ static void schedule_autocommit(struct dm_integrity_c *ic)
11051105
static void submit_flush_bio(struct dm_integrity_c *ic, struct dm_integrity_io *dio)
11061106
{
11071107
struct bio *bio;
1108-
spin_lock_irq(&ic->endio_wait.lock);
1108+
unsigned long flags;
1109+
1110+
spin_lock_irqsave(&ic->endio_wait.lock, flags);
11091111
bio = dm_bio_from_per_bio_data(dio, sizeof(struct dm_integrity_io));
11101112
bio_list_add(&ic->flush_bio_list, bio);
1111-
spin_unlock_irq(&ic->endio_wait.lock);
1113+
spin_unlock_irqrestore(&ic->endio_wait.lock, flags);
1114+
11121115
queue_work(ic->commit_wq, &ic->commit_work);
11131116
}
11141117

0 commit comments

Comments
 (0)