Skip to contentSkip to conversation

fix xfs_copy betwen devices with mismatching sizes

PATCH New Christoph Hellwig 1 participant 2 messages Jul 29

lore
Share & tools
lore
#0 lore raw

This fixes copy between devices with different alignment requirements. xfs/601 trigges this when TEST_DIR is on a device that requires minimal alignment, but SCRATCH_DEV is on a device that requires more alignment.

#1 lore raw

PATCH 1/2 copy: log the error number when failing to write

Log the string form of the errno value to help debugging a failed write.

---
 copy/xfs_copy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
copy/xfs_copy.c +2 -2
index 3ba9a07e4469..ad18ceb1ac1b 100644
@@ -891,8 +891,8 @@ main(int argc, char **argv)
 			off -= XFS_MAX_SECTORSIZE;
 			len = pwrite(target[i].fd, lb, XFS_MAX_SECTORSIZE, off);
 			if (len < 0) {
-				do_log(_("%s:  failed to write last block\n"),
-					progname);
+				do_log(_("%s:  failed to write last block: %s\n"),
+					progname, strerror(errno));
 				do_log(_("\tIs target \"%s\" too small?\n"),
 					target[i].name);
 				die_perror();
Signature · 1 line
2.53.0