On Wed, 20 Dec 2017 09:38:52 +0900, Prashant Bhole wrote:
> > > 2) In case sim0 or bpf_bound_progs are  fail to create, we need to add
> > > checks before creating any file in them.  
> > 
> > What do you mean by "check before"?  Checking if creation of each file  
> > fails or not, or something different?  
> 
> For example:
> I will check if state->ddir is not NULL before creating files in it.
> 
> if (state->ddir) {
>       debugfs_create_u32("id", 0400, state->ddir, &prog->aux->id);
>       debugfs_create_file("state", 0400, state->ddir,
>                           &state->state, &nsim_bpf_string_fops);
>       debugfs_create_bool("loaded", 0400, state->ddir, &state->is_loaded);
> }

Ah, I would just error out in case we can't create any of the
sub-directories as well.

Reply via email to