]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
copy.c: add FIEMAP_FLAG_SYNC to fiemap ioctl
authorJie Liu <jeff.liu@oracle.com>
Fri, 11 Jun 2010 08:29:02 +0000 (16:29 +0800)
committerJim Meyering <meyering@redhat.com>
Sat, 22 Jan 2011 11:16:43 +0000 (12:16 +0100)
* src/copy.c (fiemap_copy): Force kernel to sync the source
file before mapping.

src/copy.c

index 1d32913ebc5d0f43ffdb89b44cb631b78917c70b..ead15b82f1ba6b7cfc04f0231b3582d856d9a760 100644 (file)
@@ -190,6 +190,7 @@ fiemap_copy (int src_fd, int dest_fd, size_t buf_size,
   do
     {
       fiemap->fm_length = FIEMAP_MAX_OFFSET;
+      fiemap->fm_flags = FIEMAP_FLAG_SYNC;
       fiemap->fm_extent_count = count;
 
       /* When ioctl(2) fails, fall back to the normal copy only if it