Re: [PATCH 1/3] vfs: move create error && negative dentry case in lookup_open() up

From: Paul Moore

Date: Fri Jul 24 2026 - 17:12:24 EST


On Jul 10, 2026 Jori Koolstra <jkoolstra@xxxxxxxxx> wrote:
>
> O_CREAT is stripped when create_error is set in lookup_open(), so when
> lookup does not return an inode, the case
>
> if (!dentry->d_inode && (open_flag & O_CREAT))
>
> is always skipped. We can get rid of this cognitive step by handling the
> error case first.
>
> Reviewed-by: NeilBrown <neil@xxxxxxxxxx>
> Signed-off-by: Jori Koolstra <jkoolstra@xxxxxxxxx>
> ---
> fs/namei.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)

Reviewed-by: Paul Moore <paul@xxxxxxxxxxxxxx>

--
paul-moore.com