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

Commit 90fa1527 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Alasdair G Kergon
Browse files

dm snapshot: change yield to msleep



Change yield() to msleep(1). If the thread had realtime priority,
yield() doesn't really yield, so the yielding process would loop
indefinitely and cause machine lockup.

Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent a1b51e98
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -9,6 +9,7 @@
#include <linux/blkdev.h>
#include <linux/blkdev.h>
#include <linux/ctype.h>
#include <linux/ctype.h>
#include <linux/device-mapper.h>
#include <linux/device-mapper.h>
#include <linux/delay.h>
#include <linux/fs.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/kdev_t.h>
#include <linux/kdev_t.h>
@@ -735,7 +736,7 @@ static void snapshot_dtr(struct dm_target *ti)
	unregister_snapshot(s);
	unregister_snapshot(s);


	while (atomic_read(&s->pending_exceptions_count))
	while (atomic_read(&s->pending_exceptions_count))
		yield();
		msleep(1);
	/*
	/*
	 * Ensure instructions in mempool_destroy aren't reordered
	 * Ensure instructions in mempool_destroy aren't reordered
	 * before atomic_read.
	 * before atomic_read.
@@ -888,10 +889,10 @@ static void pending_complete(struct dm_snap_pending_exception *pe, int success)


	/*
	/*
	 * Check for conflicting reads. This is extremely improbable,
	 * Check for conflicting reads. This is extremely improbable,
	 * so yield() is sufficient and there is no need for a wait queue.
	 * so msleep(1) is sufficient and there is no need for a wait queue.
	 */
	 */
	while (__chunk_is_tracked(s, pe->e.old_chunk))
	while (__chunk_is_tracked(s, pe->e.old_chunk))
		yield();
		msleep(1);


	/*
	/*
	 * Add a proper exception, and remove the
	 * Add a proper exception, and remove the