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 tag 'md/3.12-fixes' of git://neil.brown.name/md

Pull md bugfixes from Neil Brown:
"Assorted md bug-fixes for 3.12.

All tagged for -stable releases too"

* tag 'md/3.12-fixes' of git://neil.brown.name/md:
raid5: avoid finding "discard" stripe
raid5: set bio bi_vcnt 0 for discard request
md: avoid deadlock when md_set_badblocks.
md: Fix skipping recovery for read-only arrays.

+25 -2
+3 -2
drivers/md/md.c
··· 8111 8111 u64 *p; 8112 8112 int lo, hi; 8113 8113 int rv = 1; 8114 + unsigned long flags; 8114 8115 8115 8116 if (bb->shift < 0) 8116 8117 /* badblocks are disabled */ ··· 8126 8125 sectors = next - s; 8127 8126 } 8128 8127 8129 - write_seqlock_irq(&bb->lock); 8128 + write_seqlock_irqsave(&bb->lock, flags); 8130 8129 8131 8130 p = bb->page; 8132 8131 lo = 0; ··· 8242 8241 bb->changed = 1; 8243 8242 if (!acknowledged) 8244 8243 bb->unacked_exist = 1; 8245 - write_sequnlock_irq(&bb->lock); 8244 + write_sequnlock_irqrestore(&bb->lock, flags); 8246 8245 8247 8246 return rv; 8248 8247 }
+1
drivers/md/raid1.c
··· 1479 1479 } 1480 1480 } 1481 1481 if (rdev 1482 + && rdev->recovery_offset == MaxSector 1482 1483 && !test_bit(Faulty, &rdev->flags) 1483 1484 && !test_and_set_bit(In_sync, &rdev->flags)) { 1484 1485 count++;
+1
drivers/md/raid10.c
··· 1782 1782 } 1783 1783 sysfs_notify_dirent_safe(tmp->replacement->sysfs_state); 1784 1784 } else if (tmp->rdev 1785 + && tmp->rdev->recovery_offset == MaxSector 1785 1786 && !test_bit(Faulty, &tmp->rdev->flags) 1786 1787 && !test_and_set_bit(In_sync, &tmp->rdev->flags)) { 1787 1788 count++;
+20
drivers/md/raid5.c
··· 778 778 bi->bi_io_vec[0].bv_len = STRIPE_SIZE; 779 779 bi->bi_io_vec[0].bv_offset = 0; 780 780 bi->bi_size = STRIPE_SIZE; 781 + /* 782 + * If this is discard request, set bi_vcnt 0. We don't 783 + * want to confuse SCSI because SCSI will replace payload 784 + */ 785 + if (rw & REQ_DISCARD) 786 + bi->bi_vcnt = 0; 781 787 if (rrdev) 782 788 set_bit(R5_DOUBLE_LOCKED, &sh->dev[i].flags); 783 789 ··· 822 816 rbi->bi_io_vec[0].bv_len = STRIPE_SIZE; 823 817 rbi->bi_io_vec[0].bv_offset = 0; 824 818 rbi->bi_size = STRIPE_SIZE; 819 + /* 820 + * If this is discard request, set bi_vcnt 0. We don't 821 + * want to confuse SCSI because SCSI will replace payload 822 + */ 823 + if (rw & REQ_DISCARD) 824 + rbi->bi_vcnt = 0; 825 825 if (conf->mddev->gendisk) 826 826 trace_block_bio_remap(bdev_get_queue(rbi->bi_bdev), 827 827 rbi, disk_devt(conf->mddev->gendisk), ··· 2922 2910 } 2923 2911 /* now that discard is done we can proceed with any sync */ 2924 2912 clear_bit(STRIPE_DISCARD, &sh->state); 2913 + /* 2914 + * SCSI discard will change some bio fields and the stripe has 2915 + * no updated data, so remove it from hash list and the stripe 2916 + * will be reinitialized 2917 + */ 2918 + spin_lock_irq(&conf->device_lock); 2919 + remove_hash(sh); 2920 + spin_unlock_irq(&conf->device_lock); 2925 2921 if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state)) 2926 2922 set_bit(STRIPE_HANDLE, &sh->state); 2927 2923