[Devel] [PATCH RHEL7 COMMIT] fs: FIEMAP should sync only required range with FIEMAP_FLAG_SYNC

Konstantin Khorenko khorenko at virtuozzo.com
Mon Jul 10 15:09:15 MSK 2017


The commit is pushed to "branch-rh7-3.10.0-514.26.1.vz7.33.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.26.1.vz7.33.2
------>
commit 00ad2e512e9fffa02951753f6e2d68afccf6e5a5
Author: Maxim Patlasov <mpatlasov at virtuozzo.com>
Date:   Mon Jul 10 16:09:15 2017 +0400

    fs: FIEMAP should sync only required range with FIEMAP_FLAG_SYNC
    
    https://jira.sw.ru/browse/PSBM-68226
    
    Signed-off-by: Alexey Kuznetsov <kuznet at virtuozzo.com>
    Signed-off-by: Maxim Patlasov <mpatlasov at virtuozzo.com>
---
 fs/ioctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/ioctl.c b/fs/ioctl.c
index dea5a20..98f84a7 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -204,7 +204,8 @@ static int ioctl_fiemap(struct file *filp, unsigned long arg)
 		return -EFAULT;
 
 	if (fieinfo.fi_flags & FIEMAP_FLAG_SYNC)
-		filemap_write_and_wait(inode->i_mapping);
+		filemap_write_and_wait_range(inode->i_mapping, fiemap.fm_start,
+					     fiemap.fm_start + len - 1);
 
 	error = inode->i_op->fiemap(inode, &fieinfo, fiemap.fm_start, len);
 	fiemap.fm_flags = fieinfo.fi_flags;


More information about the Devel mailing list