dm mpath: verify __pg_init_all_paths locking assumptions at runtime
authorBart Van Assche <bart.vanassche@sandisk.com>
Thu, 27 Apr 2017 17:11:22 +0000 (10:11 -0700)
committerMike Snitzer <snitzer@redhat.com>
Thu, 27 Apr 2017 21:08:43 +0000 (17:08 -0400)
Verify at runtime that __pg_init_all_paths() is called with
multipath.lock held if lockdep is enabled.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-mpath.c

index d85baffa33777d2170383a71ca7e519bd55a82c5..730ec0be1afa855a1c1ffc3076b8aa787201ac60 100644 (file)
@@ -298,6 +298,8 @@ static int __pg_init_all_paths(struct multipath *m)
        struct pgpath *pgpath;
        unsigned long pg_init_delay = 0;
 
+       lockdep_assert_held(&m->lock);
+
        if (atomic_read(&m->pg_init_in_progress) || test_bit(MPATHF_PG_INIT_DISABLED, &m->flags))
                return 0;