On Jul 10, 2026 Jori Koolstra <[email protected]> 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 <[email protected]>
> Signed-off-by: Jori Koolstra <[email protected]>
> ---
>  fs/namei.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)

Reviewed-by: Paul Moore <[email protected]>

--
paul-moore.com

Reply via email to