diff --git a/fs/namei.c b/fs/namei.c index a3fb78fd70d29f900c7afe96bdc2069bee4b6aa7..afa087649ddb162b14f3e9fae6cb77593037d5a4 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2608,9 +2608,10 @@ static int do_last(struct nameidata *nd, struct path *path, } /* - * It already exists. + * create/update audit record if it already exists. */ - audit_inode(pathname, path->dentry); + if (path->dentry->d_inode) + audit_inode(pathname, path->dentry); /* * If atomic_open() acquired write access it is dropped now due to