Skip to content

Commit 3b9e3ff

Browse files
committed
fhandle: do_handle_open() should get FD with user flags
JIRA: https://issues.redhat.com/browse/RHEL-113598 commit b5ca889 Author: Thomas Bertschinger <tahbertschinger@gmail.com> Date: Thu, 14 Aug 2025 17:54:28 -0600 fhandle: do_handle_open() should get FD with user flags In f07c7cc, do_handle_open() was switched to use the automatic cleanup method for getting a FD. In that change it was also switched to pass O_CLOEXEC unconditionally to get_unused_fd_flags() instead of passing the user-specified flags. I don't see anything in that commit description that indicates this was intentional, so I am assuming it was an oversight. With this fix, the FD will again be opened with, or without, O_CLOEXEC according to what the user requested. Fixes: f07c7cc ("fhandle: simplify error handling") Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com> Link: https://lore.kernel.org/20250814235431.995876-4-tahbertschinger@gmail.com Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Waiman Long <longman@redhat.com>
1 parent 182fd72 commit 3b9e3ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/fhandle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ static long do_handle_open(int mountdirfd, struct file_handle __user *ufh,
342342
if (retval)
343343
return retval;
344344

345-
CLASS(get_unused_fd, fd)(O_CLOEXEC);
345+
CLASS(get_unused_fd, fd)(open_flag);
346346
if (fd < 0)
347347
return fd;
348348

0 commit comments

Comments
 (0)