pkg/fileutil: fix F_OFD_ constants#12444
Conversation
Use golang.org/x/sys/unix for F_OFD_* constants. This fixes the issue that F_OFD_GETLK was defined incorrectly, resulting in bugs such as moby/moby#31182 Signed-off-by: Kir Kolyshkin <[email protected]>
| @@ -50,7 +45,7 @@ var ( | |||
| func init() { | |||
| // use open file descriptor locks if the system supports it | |||
| getlk := syscall.Flock_t{Type: syscall.F_RDLCK} | |||
There was a problem hiding this comment.
Why do you need to use dynamic probing for OFD locks ? This file is for Linux only.
Are OFD locks new in Linux?
There was a problem hiding this comment.
F_OFD_ locks are there since Linux kernel 3.15.
There was a problem hiding this comment.
Do you still support 3.15 and older?
There was a problem hiding this comment.
Do you still support 3.15 and older?
@joakim-tjernlund I do not know about that, I am just a contributor here. Given the fact that this package is used by other software, I think it make sense to support older kernels.
|
Can this fix be cherry-picked into stable 19 branch too ? |
|
Ping ? This bug has been around for years already. Please add fix to the release branches. |
I am not sure what do you mean by 19 branch, but I have just created a backport PR for release-3.4 branch here: #12551, as well as 3.3 (see below). Feel free to backport to older branches, too (not sure if those are still maintained). |
|
thanks, I guess this is more than enough. with branch 19 I incorrectly referred to the docker daemon which is at 19.03.14 here. |
Use golang.org/x/sys/unix for F_OFD_* constants.
This fixes the issue that F_OFD_GETLK was defined incorrectly,
resulting in bugs such as moby/moby#31182
Closes: #12440