[Devel] [PATCH rh7 21/38] ploop: fix spurious hole complains
Andrey Smetanin
asmetanin at virtuozzo.com
Fri May 15 09:48:22 PDT 2015
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);
}
--
1.9.3
More information about the Devel
mailing list