From: Mateusz Guzik Date: Sun, 9 Nov 2025 12:52:54 +0000 (+0100) Subject: fs: touch predicts in do_dentry_open() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e41c1f42919b01649ddea25b95eaa72dce2d591a;p=thirdparty%2Flinux.git fs: touch predicts in do_dentry_open() Helps out some of the asm, the routine is still a mess. Signed-off-by: Mateusz Guzik Link: https://patch.msgid.link/20251109125254.1288882-1-mjguzik@gmail.com Reviewed-by: Jan Kara Signed-off-by: Christian Brauner --- diff --git a/fs/open.c b/fs/open.c index 3d64372ecc67..e3c737ede4e4 100644 --- a/fs/open.c +++ b/fs/open.c @@ -940,7 +940,7 @@ static int do_dentry_open(struct file *f, } error = security_file_open(f); - if (error) + if (unlikely(error)) goto cleanup_all; /* @@ -950,11 +950,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 */