Re: Re: [PATCH] relay: fix potential memory leak

From: Zhouyi Zhou
Date: Wed Jun 01 2016 - 21:25:43 EST


Thanks Andrew for reviewing
> > In addition, give warning to users who forget to provide create file
> > hook.
>
> Why? What's the value in this?
>
> If the user didn't provide ->create_buf_file then setup_callbacks()
> will provide them with create_buf_file_default_callback() - what's
> wrong with that?
>
The beginners like me will probably call relay_open with base_filename
and NULL callback or callback without create_buf_file hook. This call
will fail in sub function relay_open_buf because
create_buf_file_default_callback returns empty dentry. I guess it will
be good to warn beginners to provide filesystem related create hooks at
earlier stage or they fail without knowing what has happened.

Best wishes
Zhouyi