[dm-devel] [PATCH] dm snapshot: suppress debugobjects workqueue warning

Mike Snitzer snitzer at redhat.com
Mon Jan 25 16:57:59 UTC 2010


chunk_io() declares its 'struct mdata_req' on the stack and then
initializes its 'struct work_struct' member.  Annotate the
initialization of this workqueue with INIT_WORK_ON_STACK to suppress a
debugobjects warning seen when CONFIG_DEBUG_OBJECTS_WORK is enabled:

  ODEBUG: object is on stack, but not annotated
  ------------[ cut here ]------------
  WARNING: at lib/debugobjects.c:291 __debug_object_init+0x2b9/0x35c()
  ...
  Call Trace:
  [<ffffffff810485ac>] warn_slowpath_common+0x7c/0x94
  [<ffffffff810485d8>] warn_slowpath_null+0x14/0x16
  [<ffffffff811e113b>] __debug_object_init+0x2b9/0x35c
  [<ffffffff811e120b>] debug_object_init+0x14/0x16
  [<ffffffff810606c0>] __init_work+0x27/0x29
  [<ffffffffa0077306>] chunk_io+0xba/0x127 [dm_snapshot]
  ...

Signed-off-by: Mike Snitzer <snitzer at redhat.com>
---

diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c
index 7d08879..c097d8a 100644
--- a/drivers/md/dm-snap-persistent.c
+++ b/drivers/md/dm-snap-persistent.c
@@ -254,7 +254,7 @@ static int chunk_io(struct pstore *ps, void *area, chunk_t chunk, int rw,
 	 * Issue the synchronous I/O from a different thread
 	 * to avoid generic_make_request recursion.
 	 */
-	INIT_WORK(&req.work, do_metadata);
+	INIT_WORK_ON_STACK(&req.work, do_metadata);
 	queue_work(ps->metadata_wq, &req.work);
 	flush_workqueue(ps->metadata_wq);
 




More information about the dm-devel mailing list