Commit 5e5dab5e authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Mike Snitzer
Browse files

dm integrity: flush the journal on suspend



This commit flushes the journal on suspend. It is prerequisite for the
next commit that enables activating dm integrity devices in read-only mode.

Note that we deliberately didn't flush the journal on suspend, so that the
journal replay code would be tested. However, the dm-integrity code is 5
years old now, so that journal replay is well-tested, and we can make this
change now.

Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
parent 0dfc1f4c
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -2591,10 +2591,6 @@ static void integrity_writer(struct work_struct *w)

	unsigned prev_free_sectors;

	/* the following test is not needed, but it tests the replay code */
	if (unlikely(dm_post_suspending(ic->ti)) && !ic->meta_dev)
		return;

	spin_lock_irq(&ic->endio_wait.lock);
	write_start = ic->committed_section;
	write_sections = ic->n_committed_sections;
@@ -3101,7 +3097,6 @@ static void dm_integrity_postsuspend(struct dm_target *ti)
	drain_workqueue(ic->commit_wq);

	if (ic->mode == 'J') {
		if (ic->meta_dev)
		queue_work(ic->writer_wq, &ic->writer_work);
		drain_workqueue(ic->writer_wq);
		dm_integrity_flush_buffers(ic, true);