linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Zhouyi Zhou" <yizhouzhou@ict.ac.cn>
Cc: penberg@kernel.org, viro@zeniv.linux.org.uk,
	linux-kernel@vger.kernel.org,
	"Zhouyi Zhou" <zhouzhouyi@gmail.com>,
	"Jens Axboe" <axboe@kernel.dk>
Subject: Re: [PATCH] relay: fix potential memory leak
Date: Wed, 1 Jun 2016 19:11:29 -0700	[thread overview]
Message-ID: <20160601191129.255e89da95519fb97d2aaa76@linux-foundation.org> (raw)
In-Reply-To: <13299a4.23e72.1550eb5d0fc.Coremail.yizhouzhou@ict.ac.cn>

On Thu, 2 Jun 2016 09:24:04 +0800 (GMT+08:00) "Zhouyi Zhou" <yizhouzhou@ict.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.

      reply	other threads:[~2016-06-02  2:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 10:45 [PATCH] relay: fix potential memory leak Zhouyi Zhou
2016-06-01 21:56 ` Andrew Morton
2016-06-02  1:24   ` Zhouyi Zhou
2016-06-02  2:11     ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160601191129.255e89da95519fb97d2aaa76@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yizhouzhou@ict.ac.cn \
    --cc=zhouzhouyi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).