Skip to content

Commit b5ca889

Browse files
bertschingertbrauner
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/[email protected] Reviewed-by: Amir Goldstein <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 6d3c3ca commit b5ca889

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/fhandle.c

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

405-
CLASS(get_unused_fd, fd)(O_CLOEXEC);
405+
CLASS(get_unused_fd, fd)(open_flag);
406406
if (fd < 0)
407407
return fd;
408408

0 commit comments

Comments
 (0)