Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15ecf9a9 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'md/4.3-fixes' of git://neil.brown.name/md

Pull md fixes from Neil Brown:
 "Assorted fixes for md in 4.3-rc.

  Two tagged for -stable, and one is really a cleanup to match and
  improve kmemcache interface.

* tag 'md/4.3-fixes' of git://neil.brown.name/md:
  md/bitmap: don't pass -1 to bitmap_storage_alloc.
  md/raid1: Avoid raid1 resync getting stuck
  md: drop null test before destroy functions
  md: clear CHANGE_PENDING in readonly array
  md/raid0: apply base queue limits *before* disk_stack_limits
  md/raid5: don't index beyond end of array in need_this_block().
  raid5: update analysis state for failed stripe
  md: wait for pending superblock updates before switching to read-only
parents 0d877081 da6fb7a9
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1997,7 +1997,8 @@ int bitmap_resize(struct bitmap *bitmap, sector_t blocks,
	if (bitmap->mddev->bitmap_info.offset || bitmap->mddev->bitmap_info.file)
	if (bitmap->mddev->bitmap_info.offset || bitmap->mddev->bitmap_info.file)
		ret = bitmap_storage_alloc(&store, chunks,
		ret = bitmap_storage_alloc(&store, chunks,
					   !bitmap->mddev->bitmap_info.external,
					   !bitmap->mddev->bitmap_info.external,
					   bitmap->cluster_slot);
					   mddev_is_clustered(bitmap->mddev)
					   ? bitmap->cluster_slot : 0);
	if (ret)
	if (ret)
		goto err;
		goto err;


+5 −0
Original line number Original line Diff line number Diff line
@@ -5409,9 +5409,13 @@ static int md_set_readonly(struct mddev *mddev, struct block_device *bdev)
		 * which will now never happen */
		 * which will now never happen */
		wake_up_process(mddev->sync_thread->tsk);
		wake_up_process(mddev->sync_thread->tsk);


	if (mddev->external && test_bit(MD_CHANGE_PENDING, &mddev->flags))
		return -EBUSY;
	mddev_unlock(mddev);
	mddev_unlock(mddev);
	wait_event(resync_wait, !test_bit(MD_RECOVERY_RUNNING,
	wait_event(resync_wait, !test_bit(MD_RECOVERY_RUNNING,
					  &mddev->recovery));
					  &mddev->recovery));
	wait_event(mddev->sb_wait,
		   !test_bit(MD_CHANGE_PENDING, &mddev->flags));
	mddev_lock_nointr(mddev);
	mddev_lock_nointr(mddev);


	mutex_lock(&mddev->open_mutex);
	mutex_lock(&mddev->open_mutex);
@@ -8160,6 +8164,7 @@ void md_check_recovery(struct mddev *mddev)
			md_reap_sync_thread(mddev);
			md_reap_sync_thread(mddev);
			clear_bit(MD_RECOVERY_RECOVER, &mddev->recovery);
			clear_bit(MD_RECOVERY_RECOVER, &mddev->recovery);
			clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
			clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
			clear_bit(MD_CHANGE_PENDING, &mddev->flags);
			goto unlock;
			goto unlock;
		}
		}


+1 −2
Original line number Original line Diff line number Diff line
@@ -470,7 +470,6 @@ static int multipath_run (struct mddev *mddev)
	return 0;
	return 0;


out_free_conf:
out_free_conf:
	if (conf->pool)
	mempool_destroy(conf->pool);
	mempool_destroy(conf->pool);
	kfree(conf->multipaths);
	kfree(conf->multipaths);
	kfree(conf);
	kfree(conf);
+6 −6
Original line number Original line Diff line number Diff line
@@ -376,12 +376,6 @@ static int raid0_run(struct mddev *mddev)
		struct md_rdev *rdev;
		struct md_rdev *rdev;
		bool discard_supported = false;
		bool discard_supported = false;


		rdev_for_each(rdev, mddev) {
			disk_stack_limits(mddev->gendisk, rdev->bdev,
					  rdev->data_offset << 9);
			if (blk_queue_discard(bdev_get_queue(rdev->bdev)))
				discard_supported = true;
		}
		blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
		blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
		blk_queue_max_write_same_sectors(mddev->queue, mddev->chunk_sectors);
		blk_queue_max_write_same_sectors(mddev->queue, mddev->chunk_sectors);
		blk_queue_max_discard_sectors(mddev->queue, mddev->chunk_sectors);
		blk_queue_max_discard_sectors(mddev->queue, mddev->chunk_sectors);
@@ -390,6 +384,12 @@ static int raid0_run(struct mddev *mddev)
		blk_queue_io_opt(mddev->queue,
		blk_queue_io_opt(mddev->queue,
				 (mddev->chunk_sectors << 9) * mddev->raid_disks);
				 (mddev->chunk_sectors << 9) * mddev->raid_disks);


		rdev_for_each(rdev, mddev) {
			disk_stack_limits(mddev->gendisk, rdev->bdev,
					  rdev->data_offset << 9);
			if (blk_queue_discard(bdev_get_queue(rdev->bdev)))
				discard_supported = true;
		}
		if (!discard_supported)
		if (!discard_supported)
			queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
			queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
		else
		else
+4 −7
Original line number Original line Diff line number Diff line
@@ -881,8 +881,7 @@ static sector_t wait_barrier(struct r1conf *conf, struct bio *bio)
	}
	}


	if (bio && bio_data_dir(bio) == WRITE) {
	if (bio && bio_data_dir(bio) == WRITE) {
		if (bio->bi_iter.bi_sector >=
		if (bio->bi_iter.bi_sector >= conf->next_resync) {
		    conf->mddev->curr_resync_completed) {
			if (conf->start_next_window == MaxSector)
			if (conf->start_next_window == MaxSector)
				conf->start_next_window =
				conf->start_next_window =
					conf->next_resync +
					conf->next_resync +
@@ -1516,7 +1515,7 @@ static void close_sync(struct r1conf *conf)
	conf->r1buf_pool = NULL;
	conf->r1buf_pool = NULL;


	spin_lock_irq(&conf->resync_lock);
	spin_lock_irq(&conf->resync_lock);
	conf->next_resync = 0;
	conf->next_resync = MaxSector - 2 * NEXT_NORMALIO_DISTANCE;
	conf->start_next_window = MaxSector;
	conf->start_next_window = MaxSector;
	conf->current_window_requests +=
	conf->current_window_requests +=
		conf->next_window_requests;
		conf->next_window_requests;
@@ -2843,7 +2842,6 @@ static struct r1conf *setup_conf(struct mddev *mddev)


 abort:
 abort:
	if (conf) {
	if (conf) {
		if (conf->r1bio_pool)
		mempool_destroy(conf->r1bio_pool);
		mempool_destroy(conf->r1bio_pool);
		kfree(conf->mirrors);
		kfree(conf->mirrors);
		safe_put_page(conf->tmppage);
		safe_put_page(conf->tmppage);
@@ -2946,7 +2944,6 @@ static void raid1_free(struct mddev *mddev, void *priv)
{
{
	struct r1conf *conf = priv;
	struct r1conf *conf = priv;


	if (conf->r1bio_pool)
	mempool_destroy(conf->r1bio_pool);
	mempool_destroy(conf->r1bio_pool);
	kfree(conf->mirrors);
	kfree(conf->mirrors);
	safe_put_page(conf->tmppage);
	safe_put_page(conf->tmppage);
Loading