Skip to content

Commit 1f2e58d

Browse files
tklauserianlancetaylor
authored andcommitted
[release-branch.go1.15] internal/poll: treat copy_file_range EIO as not-handled
For #42334 Fixes #42369 Change-Id: Ife51df4e7d2539a04393abfdec45e3f902975fca Reviewed-on: https://go-review.googlesource.com/c/go/+/266940 Trust: Tobias Klauser <[email protected]> Run-TryBot: Tobias Klauser <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> (cherry picked from commit 633f9e2) Reviewed-on: https://go-review.googlesource.com/c/go/+/267917 Trust: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Tobias Klauser <[email protected]>
1 parent 0e953ad commit 1f2e58d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/internal/poll/copy_file_range_linux.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func CopyFileRange(dst, src *FD, remain int64) (written int64, handled bool, err
4141
// use copy_file_range(2) again.
4242
atomic.StoreInt32(&copyFileRangeSupported, 0)
4343
return 0, false, nil
44-
case syscall.EXDEV, syscall.EINVAL, syscall.EOPNOTSUPP, syscall.EPERM:
44+
case syscall.EXDEV, syscall.EINVAL, syscall.EIO, syscall.EOPNOTSUPP, syscall.EPERM:
4545
// Prior to Linux 5.3, it was not possible to
4646
// copy_file_range across file systems. Similarly to
4747
// the ENOSYS case above, if we see EXDEV, we have
@@ -53,6 +53,9 @@ func CopyFileRange(dst, src *FD, remain int64) (written int64, handled bool, err
5353
// file. This is another case where no data has been
5454
// transfered, so we consider it unhandled.
5555
//
56+
// If src and dst are on CIFS, we can see EIO.
57+
// See issue #42334.
58+
//
5659
// If the file is on NFS, we can see EOPNOTSUPP.
5760
// See issue #40731.
5861
//

0 commit comments

Comments
 (0)