Fix bug, where copy_file_range was still calling legacy copy

There was a small issue here, where it copied the data using
traditional mechanisms, even when copy_file_range was successful.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: 0eac562281782257e6f69d58bcbc13fa889f1759
Component: engine
This commit is contained in:
Sargun Dhillon
2017-11-28 14:59:56 -08:00
parent 608a03b9d5
commit 877f5d0f1f
@@ -65,7 +65,7 @@ func copyRegular(srcPath, dstPath string, fileinfo os.FileInfo, copyWithFileRang
// as the ioctl may not have been available (therefore EINVAL)
if err == unix.EXDEV || err == unix.ENOSYS {
*copyWithFileRange = false
} else if err != nil {
} else {
return err
}
}