Browse Source

[SCSI] scsi_kmap_atomic_sg(): check that local irqs are disabled

The KM_BIO_SRC_IRQ kmap slot must be taken with local irqs disabled.  Add a
check into scsi for this.

Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Andrew Morton 18 years ago
parent
commit
22cfefb56b
1 changed files with 2 additions and 0 deletions
  1. 2 0
      drivers/scsi/scsi_lib.c

+ 2 - 0
drivers/scsi/scsi_lib.c

@@ -2250,6 +2250,8 @@ void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count,
 	size_t sg_len = 0, len_complete = 0;
 	size_t sg_len = 0, len_complete = 0;
 	struct page *page;
 	struct page *page;
 
 
+	WARN_ON(!irqs_disabled());
+
 	for (i = 0; i < sg_count; i++) {
 	for (i = 0; i < sg_count; i++) {
 		len_complete = sg_len; /* Complete sg-entries */
 		len_complete = sg_len; /* Complete sg-entries */
 		sg_len += sg[i].length;
 		sg_len += sg[i].length;