block: catch trying to use more bits than request->cmd_flags has
authorNikanth Karthikesan <knikanth@suse.de>
Mon, 27 Apr 2009 12:53:54 +0000 (14:53 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 28 Apr 2009 05:37:37 +0000 (07:37 +0200)
Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/blk-core.c

index 1e3b97f0ae6e6c4d898397dd284d83502f1c88df..394c5bd81271830b6caf995ccbc30c1c5dab3e0b 100644 (file)
@@ -2097,6 +2097,9 @@ EXPORT_SYMBOL(kblockd_schedule_work);
 
 int __init blk_dev_init(void)
 {
+       BUILD_BUG_ON(__REQ_NR_BITS > 8 *
+                       sizeof(((struct request *)0)->cmd_flags));
+
        kblockd_workqueue = create_workqueue("kblockd");
        if (!kblockd_workqueue)
                panic("Failed to create kblockd\n");