]> 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>
Fri, 11 Jun 2010 13:30:58 +0000 (15:30 +0200)
* src/copy.c (fiemap_copy): Force kernel to sync the source
file before mapping.

src/copy.c

index f149be460fc8c9fe44f1e64754991096968ca310..f48c74df738d13d69f7069da66f18d5eae5d83d4 100644 (file)
@@ -191,6 +191,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