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

Commit 6cd52ae3 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Sasha Levin
Browse files

dm writecache: add cond_resched to loop in persistent_memory_claim()



commit d35bd764e6899a7bea71958f08d16cea5bfa1919 upstream.

Add cond_resched() to a loop that fills in the mapper memory area
because the loop can be executed many times.

Fixes: 48debafe ("dm: add writecache target")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a33e2d0a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -281,6 +281,8 @@ static int persistent_memory_claim(struct dm_writecache *wc)
			while (daa-- && i < p) {
				pages[i++] = pfn_t_to_page(pfn);
				pfn.val++;
				if (!(i & 15))
					cond_resched();
			}
		} while (i < p);
		wc->memory_map = vmap(pages, p, VM_MAP, PAGE_KERNEL);