Skip to content

Commit d3a411b

Browse files
internal/poll: treat copy_file_range EOPNOTSUPP as not-handled
Fixes #40731 Change-Id: I3e29878d597318acf5edcc38497aa2624f72be35 Reviewed-on: https://go-review.googlesource.com/c/go/+/248258 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Emmanuel Odeke <[email protected]> Reviewed-by: Tobias Klauser <[email protected]>
1 parent bd519d0 commit d3a411b

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:
44+
case syscall.EXDEV, syscall.EINVAL, syscall.EOPNOTSUPP:
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
@@ -52,6 +52,9 @@ func CopyFileRange(dst, src *FD, remain int64) (written int64, handled bool, err
5252
// dst or src refer to a pipe rather than a regular
5353
// file. This is another case where no data has been
5454
// transfered, so we consider it unhandled.
55+
//
56+
// If the file is on NFS, we can see EOPNOTSUPP.
57+
// See issue #40731.
5558
return 0, false, nil
5659
case nil:
5760
if n == 0 {

0 commit comments

Comments
 (0)