unix/linux: support AT_HANDLE_{FID,CONNECTABLE,MNT_ID_UNIQUE}#269
unix/linux: support AT_HANDLE_{FID,CONNECTABLE,MNT_ID_UNIQUE}#269cyphar wants to merge 1 commit intogolang:masterfrom
Conversation
|
This PR (HEAD: e82b5ed) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/sys/+/766780. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/766780. |
|
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/766780. |
|
Message from Ian Lance Taylor: Patch Set 2: Hold+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/766780. |
AT_HANDLE_FID and AT_HANDLE_CONNECTABLE are just plain flag defintions. However, AT_HANDLE_MNT_ID_UNIQUE requires some special handling because it indicates that the mount ID pointer argument is actually a uint64. Unfortunately, providing this information to the caller would require changing the function signature (and a quick code search on GitHub found several examples where this would break existing programs) so we instead add a new function OpenByHandleAt64 that can return a uint64 mount ID. Because it makes little sense to return truncated unique mount IDs, AT_HANDLE_MNT_ID_UNIQUE is silently masked in the legacy OpenByHandleAt wrapper. Note that passing this flag value to OpenByHandleAt before this patch would actually cause stack corruption, so this will not regress existing working programs (as such programs are already broken).
|
This PR (HEAD: 5595394) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/sys/+/766780. Important tips:
|
|
Message from Aleksa Sarai: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/766780. |
AT_HANDLE_FID and AT_HANDLE_CONNECTABLE are just plain flag defintions.
However, AT_HANDLE_MNT_ID_UNIQUE requires some special handling because
it indicates that the mount ID pointer argument is actually a uint64.
Unfortunately, providing this information to the caller would require
changing the function signature (and a quick code search on GitHub found
several examples where this would break existing programs) so we instead
add a new function OpenByHandleAt64 that can return a uint64 mount ID.
Because it makes little sense to return truncated unique mount IDs,
AT_HANDLE_MNT_ID_UNIQUE is silently masked in the legacy OpenByHandleAt
wrapper. Note that passing this flag value to OpenByHandleAt before this
patch would actually cause stack corruption, so this will not regress
existing working programs (as such programs are already broken).
Fixes golang/go#78742