[Devel] [PATCH RH8 2/2] ploop: Mask as PF_IO_THREAD

Kirill Tkhai ktkhai at virtuozzo.com
Tue Jun 15 13:19:25 MSK 2021


Instead of to port ce614bb81377 "ploop: check ENOSPC callback"
and e5a3cf36977e "ext4/ploop: ask ploop about ENOSPC condition",
simplify them via this patch, which will use ext4 generic space
checker. This prevents it to use fs root reserves.

https://jira.sw.ru/browse/PSBM-127225

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

diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index 37d6fe3c94b9..a89164ed3736 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -1621,6 +1621,9 @@ void do_ploop_work(struct work_struct *ws)
 	struct ploop_index_wb piwb;
 	LIST_HEAD(deferred_pios);
 	LIST_HEAD(discard_pios);
+	unsigned int pf_io_thread = (current->flags & PF_IO_THREAD);
+
+	current->flags |= PF_IO_THREAD;
 
 	/*
 	 * In piwb we collect inquires of indexes updates, which are
@@ -1652,6 +1655,8 @@ void do_ploop_work(struct work_struct *ws)
 	}
 
 	check_services_timeout(ploop);
+
+	current->flags = (current->flags & ~PF_IO_THREAD) | pf_io_thread;
 }
 
 void do_ploop_fsync_work(struct work_struct *ws)




More information about the Devel mailing list