block: document blk_plug list access
authorShaohua Li <shaohua.li@intel.com>
Fri, 8 Jul 2011 06:19:21 +0000 (08:19 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Fri, 8 Jul 2011 06:19:21 +0000 (08:19 +0200)
I'm often confused why not disable preempt when changing blk_plug list. It
would be better to add comments here in case others have the similar concerns.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
include/linux/blkdev.h

index 92edb9601242d1c8252056d5820925fd2d2821f1..6dcea6885a5d0ca1297ff92180574edfb42a2637 100644 (file)
@@ -857,6 +857,12 @@ struct request_queue *blk_alloc_queue(gfp_t);
 struct request_queue *blk_alloc_queue_node(gfp_t, int);
 extern void blk_put_queue(struct request_queue *);
 
+/*
+ * Note: Code in between changing the blk_plug list/cb_list or element of such
+ * lists is preemptable, but such code can't do sleep (or be very careful),
+ * otherwise data is corrupted. For details, please check schedule() where
+ * blk_schedule_flush_plug() is called.
+ */
 struct blk_plug {
        unsigned long magic;
        struct list_head list;