-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 <kolyshkin@gmail.com>
@@ -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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F_OFD_ locks are there since Linux kernel 3.15.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you still support 3.15 and older?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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