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

Commit 186cec31 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull device mapper fix from Mike Snitzer:
 "Fix a race in the DM cache target that caused dirty blocks to be
  marked as clean.  This could cause no writeback to occur or spurious
  dirty block counts"

* tag 'dm-3.17-fix2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm cache: fix race causing dirty blocks to be marked as clean
parents 645cc093 40aa978e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -895,8 +895,8 @@ static void migration_success_pre_commit(struct dm_cache_migration *mg)
	struct cache *cache = mg->cache;

	if (mg->writeback) {
		cell_defer(cache, mg->old_ocell, false);
		clear_dirty(cache, mg->old_oblock, mg->cblock);
		cell_defer(cache, mg->old_ocell, false);
		cleanup_migration(mg);
		return;

@@ -951,13 +951,13 @@ static void migration_success_post_commit(struct dm_cache_migration *mg)
		}

	} else {
		clear_dirty(cache, mg->new_oblock, mg->cblock);
		if (mg->requeue_holder)
			cell_defer(cache, mg->new_ocell, true);
		else {
			bio_endio(mg->new_ocell->holder, 0);
			cell_defer(cache, mg->new_ocell, false);
		}
		clear_dirty(cache, mg->new_oblock, mg->cblock);
		cleanup_migration(mg);
	}
}