[Devel] [PATCH RH9 11/22] fs: FIEMAP should sync only required range with FIEMAP_FLAG_SYNC

Andrey Zhadchenko andrey.zhadchenko at virtuozzo.com
Thu Oct 7 13:57:35 MSK 2021


From: Maxim Patlasov <mpatlasov at virtuozzo.com>

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

== combined with:

fs: ioctl_fiemap must check what filemap_write_and_wait_range returns

It's safer to check if filemap_write_and_wait_range succeeded or not.

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

Signed-off-by: Alexey Kuznetsov <kuznet at virtuozzo.com>
Signed-off-by: Maxim Patlasov <mpatlasov at virtuozzo.com>

+++
VZ 8 rebase part https://jira.sw.ru/browse/PSBM-127782
vz7 commit: 3d0e08a ("fs: FIEMAP should sync only required range with
FIEMAP_FLAG_SYNC")

Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn at virtuozzo.com>

(cherry picked from vz8 commit 4c3f1ee28088990dc4c4851a316c310416aef3f4)
Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko 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 219b552..de73720 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -191,7 +191,8 @@ int fiemap_prep(struct inode *inode, struct fiemap_extent_info *fieinfo,
 	}
 
 	if (fieinfo->fi_flags & FIEMAP_FLAG_SYNC)
-		ret = filemap_write_and_wait(inode->i_mapping);
+		ret = filemap_write_and_wait_range(inode->i_mapping,
+			start, start + *len - 1);
 	return ret;
 }
 EXPORT_SYMBOL(fiemap_prep);
-- 
1.8.3.1



More information about the Devel mailing list