xfs_copy: flush target devices before exiting
PATCH 1/1 xfs_copy: flush target devices before exiting
From: Darrick J. Wong <[email protected]>
Flush the devices we're copying to before exiting, so that we can report any write errors.
Signed-off-by Darrick J. Wong <[email protected]>
--- copy/xfs_copy.c | 4 ++++ 1 file changed, 4 insertions(+)
copy/xfs_copy.c +4 -0
@@ -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 ) {
Darrick J. Wong
NAKQuoted 23 lines · Darrick J. Wong
From: Darrick J. Wong <[email protected]>
Flush the devices we're copying to before exiting, so that we can report any write errors.
Signed-off-by Darrick J. Wong <[email protected]>--- copy/xfs_copy.c | 4 ++++ 1 file changed, 4 insertions(+)copy/xfs_copy.c +1
-0@@ -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)
copy/xfs_copy.c check_errors(void) · line 156
Quoted 6 lines
copy/xfs_copy.c +3
-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);
NAK, this should set first_error. Boooo...
--D
Quoted 3 lines
copy/xfs_copy.c +0
-0} }if (first_error ==0 ) {