Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
bio: fix memcpy corruption in bio_copy_user_iov()
hd: fix locking
mg_disk: fix CONFIG_LBD=y warning
mg_disk: fix locking

+24 -15
+7 -10
drivers/block/hd.c
··· 509 509 if (i > 0) { 510 510 SET_HANDLER(&write_intr); 511 511 outsw(HD_DATA, req->buffer, 256); 512 - local_irq_enable(); 513 512 } else { 514 513 #if (HD_DELAY > 0) 515 514 last_req = read_timer(); ··· 540 541 if (!CURRENT) 541 542 return; 542 543 543 - disable_irq(HD_IRQ); 544 - local_irq_enable(); 544 + spin_lock_irq(hd_queue->queue_lock); 545 545 reset = 1; 546 546 name = CURRENT->rq_disk->disk_name; 547 547 printk("%s: timeout\n", name); ··· 550 552 #endif 551 553 end_request(CURRENT, 0); 552 554 } 553 - local_irq_disable(); 554 555 hd_request(); 555 - enable_irq(HD_IRQ); 556 + spin_unlock_irq(hd_queue->queue_lock); 556 557 } 557 558 558 559 static int do_special_op(struct hd_i_struct *disk, struct request *req) ··· 589 592 return; 590 593 repeat: 591 594 del_timer(&device_timer); 592 - local_irq_enable(); 593 595 594 596 req = CURRENT; 595 597 if (!req) { ··· 597 601 } 598 602 599 603 if (reset) { 600 - local_irq_disable(); 601 604 reset_hd(); 602 605 return; 603 606 } ··· 655 660 656 661 static void do_hd_request(struct request_queue *q) 657 662 { 658 - disable_irq(HD_IRQ); 659 663 hd_request(); 660 - enable_irq(HD_IRQ); 661 664 } 662 665 663 666 static int hd_getgeo(struct block_device *bdev, struct hd_geometry *geo) ··· 677 684 { 678 685 void (*handler)(void) = do_hd; 679 686 687 + spin_lock(hd_queue->queue_lock); 688 + 680 689 do_hd = NULL; 681 690 del_timer(&device_timer); 682 691 if (!handler) 683 692 handler = unexpected_hd_interrupt; 684 693 handler(); 685 - local_irq_enable(); 694 + 695 + spin_unlock(hd_queue->queue_lock); 696 + 686 697 return IRQ_HANDLED; 687 698 } 688 699
+14 -5
drivers/block/mg_disk.c
··· 79 79 if (host->breq) { 80 80 req = elv_next_request(host->breq); 81 81 if (req) 82 - printk(", sector=%ld", req->sector); 82 + printk(", sector=%u", (u32)req->sector); 83 83 } 84 84 85 85 } ··· 160 160 struct mg_host *host = dev_id; 161 161 void (*handler)(struct mg_host *) = host->mg_do_intr; 162 162 163 - host->mg_do_intr = 0; 163 + spin_lock(&host->lock); 164 + 165 + host->mg_do_intr = NULL; 164 166 del_timer(&host->timer); 165 167 if (!handler) 166 168 handler = mg_unexpected_intr; 167 169 handler(host); 170 + 171 + spin_unlock(&host->lock); 172 + 168 173 return IRQ_HANDLED; 169 174 } 170 175 ··· 324 319 325 320 remains = req->nr_sectors; 326 321 327 - if (mg_out(host, req->sector, req->nr_sectors, MG_CMD_RD, 0) != 322 + if (mg_out(host, req->sector, req->nr_sectors, MG_CMD_RD, NULL) != 328 323 MG_ERR_NONE) 329 324 mg_bad_rw_intr(host); 330 325 ··· 368 363 369 364 remains = req->nr_sectors; 370 365 371 - if (mg_out(host, req->sector, req->nr_sectors, MG_CMD_WR, 0) != 366 + if (mg_out(host, req->sector, req->nr_sectors, MG_CMD_WR, NULL) != 372 367 MG_ERR_NONE) { 373 368 mg_bad_rw_intr(host); 374 369 return; ··· 526 521 char *name; 527 522 struct request *req; 528 523 524 + spin_lock_irq(&host->lock); 525 + 529 526 req = elv_next_request(host->breq); 530 527 if (!req) 531 - return; 528 + goto out_unlock; 532 529 533 530 host->mg_do_intr = NULL; 534 531 ··· 541 534 mg_bad_rw_intr(host); 542 535 543 536 mg_request(host->breq); 537 + out_unlock: 538 + spin_unlock_irq(&host->lock); 544 539 } 545 540 546 541 static void mg_request_poll(struct request_queue *q)
+3
fs/bio.c
··· 817 817 len += iov[i].iov_len; 818 818 } 819 819 820 + if (offset) 821 + nr_pages++; 822 + 820 823 bmd = bio_alloc_map_data(nr_pages, iov_count, gfp_mask); 821 824 if (!bmd) 822 825 return ERR_PTR(-ENOMEM);