[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20160601191129.255e89da95519fb97d2aaa76@linux-foundation.org>
Date: Wed, 1 Jun 2016 19:11:29 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: "Zhouyi Zhou" <yizhouzhou@....ac.cn>
Cc: penberg@...nel.org, viro@...iv.linux.org.uk,
linux-kernel@...r.kernel.org, "Zhouyi Zhou" <zhouzhouyi@...il.com>,
"Jens Axboe" <axboe@...nel.dk>
Subject: Re: [PATCH] relay: fix potential memory leak
On Thu, 2 Jun 2016 09:24:04 +0800 (GMT+08:00) "Zhouyi Zhou" <yizhouzhou@....ac.cn> wrote:
> 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.
There is no end to the code which we could add to help beginners! So
let's just fix the bug please, and we can discuss such development aids
separately.
Powered by blists - more mailing lists