[Devel] [PATCH RH8] ploop: Use kmap_atomic() instead of kmap()

Kirill Tkhai ktkhai at virtuozzo.com
Fri Jul 16 13:01:26 MSK 2021


We need to use kmap_atomic() under write_lock.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-ploop-cmd.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-ploop-cmd.c b/drivers/md/dm-ploop-cmd.c
index 14e7b06d88b5..b9be80492eae 100644
--- a/drivers/md/dm-ploop-cmd.c
+++ b/drivers/md/dm-ploop-cmd.c
@@ -1154,7 +1154,7 @@ static int ploop_check_delta_before_flip(struct ploop *ploop, struct file *file)
 	write_lock_irq(&ploop->bat_rwlock);
 	ploop_for_each_md_page(ploop, md, node) {
 		init_be_iter(size_in_clus, md->id, &i, &end);
-		d_bat_entries = kmap(d_md->page);
+		d_bat_entries = kmap_atomic(d_md->page);
 		for (; i <= end; i++) {
 			if (md_page_cluster_is_in_top_delta(ploop, md, i) &&
 			    d_bat_entries[i] != BAT_ENTRY_NONE) {
@@ -1170,7 +1170,7 @@ static int ploop_check_delta_before_flip(struct ploop *ploop, struct file *file)
 			goto unmap;
 		}
 unmap:
-		kunmap(d_md->page);
+		kunmap_atomic(d_bat_entries);
 		if (stop)
 			break;
 		d_md = md_next_entry(d_md);




More information about the Devel mailing list