Re: [PATCH] fs: touch predicts in do_dentry_open()
From: Jan Kara
Date: Mon Nov 10 2025 - 05:49:22 EST
On Sun 09-11-25 13:52:54, Mateusz Guzik wrote:
> Helps out some of the asm, the routine is still a mess.
>
> Signed-off-by: Mateusz Guzik <mjguzik@xxxxxxxxx>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@xxxxxxx>
Honza
> ---
> fs/open.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/open.c b/fs/open.c
> index 1d73a17192da..2a2cf9007900 100644
> --- a/fs/open.c
> +++ b/fs/open.c
> @@ -937,7 +937,7 @@ static int do_dentry_open(struct file *f,
> }
>
> error = security_file_open(f);
> - if (error)
> + if (unlikely(error))
> goto cleanup_all;
>
> /*
> @@ -947,11 +947,11 @@ static int do_dentry_open(struct file *f,
> * pseudo file, this call will not change the mode.
> */
> error = fsnotify_open_perm_and_set_mode(f);
> - if (error)
> + if (unlikely(error))
> goto cleanup_all;
>
> error = break_lease(file_inode(f), f->f_flags);
> - if (error)
> + if (unlikely(error))
> goto cleanup_all;
>
> /* normally all 3 are set; ->open() can clear them if needed */
> --
> 2.48.1
>
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR