Re: [BUG] copy_file_range with sysfs file as input

2021-02-03 Thread Nicolas Boichat
On Wed, Feb 3, 2021 at 5:04 PM Greg KH wrote: > > On Mon, Jan 25, 2021 at 03:54:31PM +0800, Nicolas Boichat wrote: > > Hi copy_file_range experts, > > > > We hit this interesting issue when upgrading Go compiler from 1.13 to > > 1.15 [1]. Basically we use Go's `io.Copy` to copy the content of > >

Re: [BUG] copy_file_range with sysfs file as input

2021-02-03 Thread Greg KH
On Mon, Jan 25, 2021 at 03:54:31PM +0800, Nicolas Boichat wrote: > Hi copy_file_range experts, > > We hit this interesting issue when upgrading Go compiler from 1.13 to > 1.15 [1]. Basically we use Go's `io.Copy` to copy the content of > `/sys/kernel/debug/tracing/trace` to a temporary file. Nit,

Re: [BUG] copy_file_range with sysfs file as input

2021-01-26 Thread Dave Chinner
On Tue, Jan 26, 2021 at 11:50:50AM +0800, Nicolas Boichat wrote: > On Tue, Jan 26, 2021 at 9:34 AM Dave Chinner wrote: > > > > On Mon, Jan 25, 2021 at 03:54:31PM +0800, Nicolas Boichat wrote: > > > Hi copy_file_range experts, > > > > > > We hit this interesting issue when upgrading Go compiler fro

Re: [BUG] copy_file_range with sysfs file as input

2021-01-26 Thread Nicolas Boichat
On Tue, Jan 26, 2021 at 9:34 AM Dave Chinner wrote: > > On Mon, Jan 25, 2021 at 03:54:31PM +0800, Nicolas Boichat wrote: > > Hi copy_file_range experts, > > > > We hit this interesting issue when upgrading Go compiler from 1.13 to > > 1.15 [1]. Basically we use Go's `io.Copy` to copy the content o

Re: [BUG] copy_file_range with sysfs file as input

2021-01-26 Thread Dave Chinner
On Mon, Jan 25, 2021 at 03:54:31PM +0800, Nicolas Boichat wrote: > Hi copy_file_range experts, > > We hit this interesting issue when upgrading Go compiler from 1.13 to > 1.15 [1]. Basically we use Go's `io.Copy` to copy the content of > `/sys/kernel/debug/tracing/trace` to a temporary file. > >

Re: [BUG] copy_file_range with sysfs file as input

2021-01-25 Thread Ian Lance Taylor
Thanks for the note. I'm not a kernel developer, but to me this sounds like a kernel bug. It seems particularly unfortunate that copy_file_range returns 0 in this case. From the perspective of the Go standard library, what we would need is some mechanism to detect when the copy_file_range system

[BUG] copy_file_range with sysfs file as input

2021-01-25 Thread Nicolas Boichat
Hi copy_file_range experts, We hit this interesting issue when upgrading Go compiler from 1.13 to 1.15 [1]. Basically we use Go's `io.Copy` to copy the content of `/sys/kernel/debug/tracing/trace` to a temporary file. Under the hood, Go now uses `copy_file_range` syscall to optimize the copy oper