@@ -2957,17 +2957,13 @@ static struct dentry *atomic_open(struct nameidata *nd, struct dentry *dentry,
2957
2957
dput (dentry );
2958
2958
dentry = dget (file -> f_path .dentry );
2959
2959
}
2960
- if (file -> f_mode & FMODE_CREATED )
2961
- fsnotify_create (dir , dentry );
2962
2960
} else if (WARN_ON (file -> f_path .dentry == DENTRY_NOT_SET )) {
2963
2961
error = - EIO ;
2964
2962
} else {
2965
2963
if (file -> f_path .dentry ) {
2966
2964
dput (dentry );
2967
2965
dentry = file -> f_path .dentry ;
2968
2966
}
2969
- if (file -> f_mode & FMODE_CREATED )
2970
- fsnotify_create (dir , dentry );
2971
2967
if (unlikely (d_is_negative (dentry )))
2972
2968
error = - ENOENT ;
2973
2969
}
@@ -3103,7 +3099,6 @@ static struct dentry *lookup_open(struct nameidata *nd, struct file *file,
3103
3099
open_flag & O_EXCL );
3104
3100
if (error )
3105
3101
goto out_dput ;
3106
- fsnotify_create (dir_inode , dentry );
3107
3102
}
3108
3103
if (unlikely (create_error ) && !dentry -> d_inode ) {
3109
3104
error = create_error ;
@@ -3182,6 +3177,8 @@ static const char *open_last_lookups(struct nameidata *nd,
3182
3177
else
3183
3178
inode_lock_shared (dir -> d_inode );
3184
3179
dentry = lookup_open (nd , file , op , got_write );
3180
+ if (!IS_ERR (dentry ) && (file -> f_mode & FMODE_CREATED ))
3181
+ fsnotify_create (dir -> d_inode , dentry );
3185
3182
if (open_flag & O_CREAT )
3186
3183
inode_unlock (dir -> d_inode );
3187
3184
else
0 commit comments