[Devel] [PATCH RHEL7 COMMIT] ploop: fix spurious hole complains

Konstantin Khorenko khorenko at odin.com
Mon May 18 21:27:07 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.1
------>
commit e4c1ce43241df81fad73953200d887c6a402d82f
Author: Andrey Smetanin <asmetanin at virtuozzo.com>
Date:   Tue May 19 08:27:07 2015 +0400

    ploop: fix spurious hole complains
    
    Spurious complains were triggered by fiemap-ahead logic of pio_direct module.
    Fix it by suppressing complains if fiemap behind EOF failed. Also print
    more details about a hole.
    
    Signed-off-by: Maxim Patlasov <MPatlasov at parallels.com>
    
    Acked-by: Andrew Vagin <avagin at parallels.com>
---
 drivers/block/ploop/io_direct_map.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/block/ploop/io_direct_map.c b/drivers/block/ploop/io_direct_map.c
index b9a0ce9..c1d889b 100644
--- a/drivers/block/ploop/io_direct_map.c
+++ b/drivers/block/ploop/io_direct_map.c
@@ -681,7 +681,7 @@ again:
 
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
-	ret = inode->i_op->fiemap(inode, &fieinfo, start << 9, 1);
+	ret = inode->i_op->fiemap(inode, &fieinfo, start_off, 1);
 
 	/* chase for PSBM-26762: em->block_start == 0 */
 	if (!ret && fieinfo.fi_extents_mapped == 1 &&
@@ -709,8 +709,11 @@ again:
 	}
 
 	if (fieinfo.fi_extents_mapped != 1) {
-		ploop_msg_once(io->plo, "a hole in image file detected (%d)",
-			       fieinfo.fi_extents_mapped);
+		if (start_off < i_size_read(inode))
+			ploop_msg_once(io->plo, "a hole in image file detected"
+				       " (mapped=%d i_size=%llu off=%llu)",
+				       fieinfo.fi_extents_mapped,
+				       i_size_read(inode), start_off);
 		extent_put(em);
 		return ERR_PTR(-EINVAL);
 	}



More information about the Devel mailing list