[Devel] [PATCH] ploop: Fix locking imballance

Kirill Tkhai ktkhai at virtuozzo.com
Tue Apr 16 13:57:05 MSK 2019


Move file_start_write() up.

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

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

diff --git a/drivers/block/ploop/io_direct.c b/drivers/block/ploop/io_direct.c
index 9fd2075661ad..43e3dcdcd969 100644
--- a/drivers/block/ploop/io_direct.c
+++ b/drivers/block/ploop/io_direct.c
@@ -401,14 +401,14 @@ cached_submit(struct ploop_io *io, iblock_t iblk, struct ploop_request * preq,
 	used_pos = (loff_t)(io->alloc_head - 1) << (io->plo->cluster_log + 9);
 	reusing = (end_pos <= used_pos);
 
+	file_start_write(io->files.file);
+
 	if (reusing) {
 		/* Reusing a hole */
 		prealloc = clu_siz;
 		goto try_again;
 	}
 
-	file_start_write(io->files.file);
-
 	if (use_prealloc && (end_pos > used_pos) && may_fallocate) {
 		if (unlikely(io->prealloced_size < used_pos + clu_siz)) {
 			prealloc = end_pos;



More information about the Devel mailing list