X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=fs%2Ftracefs%2Finode.c;h=0292c6a2bed9f2b2c237ac8f3d1e89c3fb9dc271;hb=6abb8c223ce12078a0f2c129656a13338dfe960b;hp=891653ba9cf35863f5cc83638b2a2a9a88a03444;hpb=2dc4e0f45593abc53d58d0073b3b314f864c522b;p=platform%2Fkernel%2Flinux-starfive.git diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c index 891653b..0292c6a 100644 --- a/fs/tracefs/inode.c +++ b/fs/tracefs/inode.c @@ -509,20 +509,15 @@ struct dentry *eventfs_start_creating(const char *name, struct dentry *parent) struct dentry *dentry; int error; + /* Must always have a parent. */ + if (WARN_ON_ONCE(!parent)) + return ERR_PTR(-EINVAL); + error = simple_pin_fs(&trace_fs_type, &tracefs_mount, &tracefs_mount_count); if (error) return ERR_PTR(error); - /* - * If the parent is not specified, we create it in the root. - * We need the root dentry to do this, which is in the super - * block. A pointer to that is in the struct vfsmount that we - * have around. - */ - if (!parent) - parent = tracefs_mount->mnt_root; - if (unlikely(IS_DEADDIR(parent->d_inode))) dentry = ERR_PTR(-ENOENT); else