[Devel] [PATCH RHEL7 COMMIT] ploop: Fix locking imballance

Konstantin Khorenko khorenko at virtuozzo.com
Tue Apr 16 14:08:21 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-957.10.1.vz7.94.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.10.1.vz7.94.14
------>
commit c6aa2b675fe941ece29d82b2fcc00d7b81851fe8
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Tue Apr 16 14:08:19 2019 +0300

    ploop: Fix locking imballance
    
    Move file_start_write() up.
    
    Fixes: 6b526783df00 ("ploop: Fallocate cluster in cached_submit() during hole
    reuse")
    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