]> git.ipfire.org Git - thirdparty/linux.git/commit
don't bother with path_get()/path_put() in unix_open_file()
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 12 Jul 2025 05:41:57 +0000 (06:41 +0100)
committerChristian Brauner <brauner@kernel.org>
Mon, 14 Jul 2025 08:22:47 +0000 (10:22 +0200)
commit1f531e35c146cca22dc6f4a1bc657098f146f358
treeb70d2dd3770c2910cfabe596c365eb29a2a3052b
parenta683a5b2ba23598ad343e5ec10a4ef4077497fc9
don't bother with path_get()/path_put() in unix_open_file()

Once unix_sock ->path is set, we are guaranteed that its ->path will remain
unchanged (and pinned) until the socket is closed.  OTOH, dentry_open()
does not modify the path passed to it.

IOW, there's no need to copy unix_sk(sk)->path in unix_open_file() - we
can just pass it to dentry_open() and be done with that.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Link: https://lore.kernel.org/20250712054157.GZ1880847@ZenIV
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
net/unix/af_unix.c