[PATCH] xfs_copy: flush target devices before exiting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

Flush the devices we're copying to before exiting, so that we can report
any write errors.

Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
---
 copy/xfs_copy.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
index 2d087f71..45ee2e06 100644
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -12,6 +12,7 @@
 #include <stdarg.h>
 #include "xfs_copy.h"
 #include "libxlog.h"
+#include "libfrog/platform.h"
 
 #define	rounddown(x, y)	(((x)/(y))*(y))
 #define uuid_equal(s,d) (platform_uuid_compare((s),(d)) == 0)
@@ -150,6 +151,9 @@ check_errors(void)
 			else
 				do_log(_("lseek error"));
 			do_log(_(" at offset %lld\n"), target[i].position);
+		} else if (platform_flush_device(target[i].fd, 0)) {
+			do_log(_("    %s -- flush error %d"),
+					target[i].name, errno);
 		}
 	}
 	if (first_error == 0)  {



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux