All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm-snapshot: workaround for a lockdep warning
@ 2013-09-17 20:47 Mikulas Patocka
  2013-09-17 23:24 ` Mikulas Patocka
  0 siblings, 1 reply; 7+ messages in thread
From: Mikulas Patocka @ 2013-09-17 20:47 UTC (permalink / raw)
  To: Alasdair G. Kergon, dm-devel

dm-snapshot: workaround for a lockdep warning

The kernel reports a lockdep warning if a snapshot is invalidated because
it runs out of space.

The lockdep warning was triggered by commit
0976dfc1d0cd80a4e9dfaf87bd8744612bde475a in the kernel 3.5.

The warning is false positive. The real cause for the warning is that the
lockdep engine treats different instances of md->lock as a single lock.

This patch is a workaround - we use flush_workqueue instead of flush_work.
This code path is not performance sensitive (it is called only on
initialization or invalidation), thus it doesn't matter that we flush the
whole workqueue.

The real fix for the problem would be to teach the lockdep engine to treat
different instances of md->lock as separate locks.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@kernel.org		# 3.5+

Index: linux-2.6-devel/drivers/md/dm-snap-persistent.c
===================================================================
--- linux-2.6-devel.orig/drivers/md/dm-snap-persistent.c	2013-05-10 18:27:31.132358000 +0200
+++ linux-2.6-devel/drivers/md/dm-snap-persistent.c	2013-09-17 18:41:39.023940000 +0200
@@ -256,7 +256,7 @@
 	 */
 	INIT_WORK_ONSTACK(&req.work, do_metadata);
 	queue_work(ps->metadata_wq, &req.work);
-	flush_work(&req.work);
+	flush_workqueue(ps->metadata_wq);
 
 	return req.result;
 }

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-09-18 23:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-17 20:47 [PATCH] dm-snapshot: workaround for a lockdep warning Mikulas Patocka
2013-09-17 23:24 ` Mikulas Patocka
2013-09-18  0:08   ` Mikulas Patocka
2013-09-18  6:57     ` Zdenek Kabelac
2013-09-18 15:57       ` Mikulas Patocka
2013-09-18 19:07         ` Zdenek Kabelac
2013-09-18 23:14           ` Mikulas Patocka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.