All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Josef Bacik <jbacik@fusionio.com>
Cc: "Chris L. Mason" <clmason@fusionio.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [patch v2] Btrfs: fix error handling in __add_reloc_root()
Date: Mon, 25 Jun 2012 13:53:44 +0000	[thread overview]
Message-ID: <20120625135344.GN5390@mwanda> (raw)
In-Reply-To: <20120625133956.GA2499@localhost.localdomain>

On Mon, Jun 25, 2012 at 09:41:12AM -0400, Josef Bacik wrote:
> On Mon, Jun 25, 2012 at 05:15:23AM -0600, Dan Carpenter wrote:
> > We dereferenced "node" in the error message after freeing it.  Also
> > btrfs_panic() can return so we should return an error code instead of
> > continuing.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> > v2: in the first version I just deleted the kfree().
> > 
> > diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
> > index 790f492..4da0865 100644
> > --- a/fs/btrfs/relocation.c
> > +++ b/fs/btrfs/relocation.c
> > @@ -1239,10 +1239,11 @@ static int __must_check __add_reloc_root(struct btrfs_root *root)
> >  			      node->bytenr, &node->rb_node);
> >  	spin_unlock(&rc->reloc_root_tree.lock);
> >  	if (rb_node) {
> > -		kfree(node);
> >  		btrfs_panic(root->fs_info, -EEXIST, "Duplicate root found "
> >  			    "for start=%llu while inserting into relocation "
> >  			    "tree\n", node->bytenr);
> > +		kfree(node);
> > +		return -EEXIST;
> >  	}
> >  
> >  	list_add_tail(&root->root_list, &rc->reloc_roots);
> 
> I'm not sure why but it seems like this patch is wrapped.  At first I thought it
> was thunderbird but then I opened it up and saved it from mutt and I got the
> same problem.  I will fix it up, but you may want to check your mail client.

The message that went through to kernel-janitors applies fine for
me.  I'm not sure what to say.

regards,
dan carpenter


WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Josef Bacik <jbacik@fusionio.com>
Cc: "Chris L. Mason" <clmason@fusionio.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [patch v2] Btrfs: fix error handling in __add_reloc_root()
Date: Mon, 25 Jun 2012 16:53:44 +0300	[thread overview]
Message-ID: <20120625135344.GN5390@mwanda> (raw)
In-Reply-To: <20120625133956.GA2499@localhost.localdomain>

On Mon, Jun 25, 2012 at 09:41:12AM -0400, Josef Bacik wrote:
> On Mon, Jun 25, 2012 at 05:15:23AM -0600, Dan Carpenter wrote:
> > We dereferenced "node" in the error message after freeing it.  Also
> > btrfs_panic() can return so we should return an error code instead of
> > continuing.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> > v2: in the first version I just deleted the kfree().
> > 
> > diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
> > index 790f492..4da0865 100644
> > --- a/fs/btrfs/relocation.c
> > +++ b/fs/btrfs/relocation.c
> > @@ -1239,10 +1239,11 @@ static int __must_check __add_reloc_root(struct btrfs_root *root)
> >  			      node->bytenr, &node->rb_node);
> >  	spin_unlock(&rc->reloc_root_tree.lock);
> >  	if (rb_node) {
> > -		kfree(node);
> >  		btrfs_panic(root->fs_info, -EEXIST, "Duplicate root found "
> >  			    "for start=%llu while inserting into relocation "
> >  			    "tree\n", node->bytenr);
> > +		kfree(node);
> > +		return -EEXIST;
> >  	}
> >  
> >  	list_add_tail(&root->root_list, &rc->reloc_roots);
> 
> I'm not sure why but it seems like this patch is wrapped.  At first I thought it
> was thunderbird but then I opened it up and saved it from mutt and I got the
> same problem.  I will fix it up, but you may want to check your mail client.

The message that went through to kernel-janitors applies fine for
me.  I'm not sure what to say.

regards,
dan carpenter


  reply	other threads:[~2012-06-25 13:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-22  7:14 [patch] Btrfs: dereferencing free'd memory in panic message Dan Carpenter
2012-06-22  7:14 ` Dan Carpenter
2012-06-22 13:09 ` Josef Bacik
2012-06-22 13:09   ` Josef Bacik
2012-06-22 13:30   ` Dan Carpenter
2012-06-22 13:30     ` Dan Carpenter
2012-06-22 13:32     ` Josef Bacik
2012-06-22 13:32       ` Josef Bacik
2012-06-25 11:15       ` [patch v2] Btrfs: fix error handling in __add_reloc_root() Dan Carpenter
2012-06-25 11:15         ` Dan Carpenter
2012-06-25 13:41         ` Josef Bacik
2012-06-25 13:41           ` Josef Bacik
2012-06-25 13:53           ` Dan Carpenter [this message]
2012-06-25 13:53             ` Dan Carpenter
2012-06-26  1:21             ` santosh prasad nayak
2012-06-26  1:33               ` santosh prasad nayak
2012-06-26  6:41               ` Dan Carpenter
2012-06-26  6:41                 ` Dan Carpenter

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=20120625135344.GN5390@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=clmason@fusionio.com \
    --cc=jbacik@fusionio.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.