[Devel] [PATCH RHEL10 COMMIT] dm-tracking: initialize dmt->lock with spin_lock_init()

Konstantin Khorenko khorenko at virtuozzo.com
Wed Aug 5 22:50:34 MSK 2026


The commit is pushed to "branch-rh10-6.12.0-211.39.1.16.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-211.39.1.16.2.vz10
------>
commit 402b7d534b6d4c30c54a2283274c8b4c858c9d3f
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Mon Jul 6 12:59:51 2026 +0200

    dm-tracking: initialize dmt->lock with spin_lock_init()
    
    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: a036ef57b6b1d ("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 <khorenko at virtuozzo.com>
---
 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 ff0ba1cc55107..9b387a92f9a98 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;


More information about the Devel mailing list