Skip to content

Commit 4531d11

Browse files
committed
procfs: fix up minor doRawProcSelfFdReadlink comment
Fixes: 45c4415 ("procfs: use readlink(fd, "") for magic-links") Signed-off-by: Aleksa Sarai <[email protected]>
1 parent ce49f6e commit 4531d11

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

procfs_linux.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,12 @@ func doRawProcSelfFdReadlink(procRoot *os.File, fd int) (string, error) {
367367
defer procFdLink.Close() //nolint:errcheck // close failures aren't critical here
368368
defer closer()
369369

370-
// Try to detect if there is a mount on top of the magic-link. Since we use the handle directly
371-
// provide to the closure. If the closure uses the handle directly, this
372-
// should be safe in general (a mount on top of the path afterwards would
373-
// not affect the handle itself) and will definitely be safe if we are
374-
// using privateProcRoot() (at least since Linux 5.12[1], when anonymous
375-
// mount namespaces were completely isolated from external mounts including
376-
// mount propagation events).
370+
// Try to detect if there is a mount on top of the magic-link. This should
371+
// be safe in general (a mount on top of the path afterwards would not
372+
// affect the handle itself) and will definitely be safe if we are using
373+
// privateProcRoot() (at least since Linux 5.12[1], when anonymous mount
374+
// namespaces were completely isolated from external mounts including mount
375+
// propagation events).
377376
//
378377
// [1]: Linux commit ee2e3f50629f ("mount: fix mounting of detached mounts
379378
// onto targets that reside on shared mounts").

0 commit comments

Comments
 (0)