struct dm_tracking is allocated with kzalloc() and its embedded
spinlock dmt->lock is taken in dmt_status()/tracking_clear()/
tracking_get_next()/dmt_cmd(), but dmt_ctr() never runs
spin_lock_init() on it (only ctl_mutex is initialized). A zero-filled
spinlock has no static lockdep key, so on the first spin_lock_irq() a
lockdep kernel prints:
INFO: trying to register non-static key.
... turning off the locking correctness validator.
_raw_spin_lock_irq <- dmt_status <- dm_ima_measure_on_table_load
<- table_load <- ctl_ioctl
and disables lockdep for the rest of the boot. Initialize the spinlock
in the constructor next to mutex_init(&dmt->ctl_mutex).
Fixes: 51958806db7e ("dm: Add dm-tracking target")
Feature: dm-tracking: dirty blocks tracking target driver (for migration)
https://virtuozzo.atlassian.net/browse/VSTOR-137234
Signed-off-by: Konstantin Khorenko <[email protected]>
---
drivers/md/dm-tracking.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/md/dm-tracking.c b/drivers/md/dm-tracking.c
index ff0ba1cc5510..9b387a92f9a9 100644
--- a/drivers/md/dm-tracking.c
+++ b/drivers/md/dm-tracking.c
@@ -153,6 +153,7 @@ static int dmt_ctr(struct dm_target *ti, unsigned int argc,
char **argv)
goto err;
mutex_init(&dmt->ctl_mutex);
+ spin_lock_init(&dmt->lock);
ti->private = dmt;
dmt->ti = ti;
--
2.47.1
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel