public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: Dan Carpenter <error27@gmail.com>,
	no@kernel.dk, To-header@kernel.dk, on@kernel.dk,
	";;chris.mason"@oracle.com, linux-btrfs@vger.kernel.org
Subject: Re: [patch] btrfs: remove dead code #3
Date: Thu, 26 Mar 2009 10:48:01 -0400	[thread overview]
Message-ID: <1238078881.5676.14.camel@think.oraclecorp.com> (raw)
In-Reply-To: <20090326143936.GE27476@kernel.dk>

On Thu, 2009-03-26 at 15:39 +0100, Jens Axboe wrote:
> On Thu, Mar 26 2009, Dan Carpenter wrote:
> > kzalloc() already initialized ->error to zero.
> > 
> > regards,
> > dan carpenter
> > 
> > Signed-off-by: Dan Carpenter <error27@gmail.com>
> > 
> > --- orig/fs/btrfs/volumes.c	2009-03-26 17:14:13.000000000 +0300
> > +++ devel/fs/btrfs/volumes.c	2009-03-26 17:14:55.000000000 +0300
> > @@ -2422,10 +2422,8 @@
> >  		multi = kzalloc(btrfs_multi_bio_size(stripes_allocated),
> >  				GFP_NOFS);
> >  		if (!multi)
> >  			return -ENOMEM;
> > -
> > -		atomic_set(&multi->error, 0);
> >  	}
> >  
> >  	spin_lock(&em_tree->lock);
> >  	em = lookup_extent_mapping(em_tree, logical, *length);
> 
> Careful, some archs require a barrier there. It's dangerous to makes
> assumptions about the underlying implementation of such things, I'd
> leave that one alone.
> 
Yeah, I'm not so much worried about the barrier as I am that assuming a
memset can init an atomic in general.

-chris



  reply	other threads:[~2009-03-26 14:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-26 13:39 btrfs: memory leak on error path error27
2009-03-26 13:42 ` btrfs: dereferencing freed memory Dan Carpenter
2009-03-26 13:45 ` btrfs: returning under lock Dan Carpenter
2009-03-26 13:54 ` unhandled kmallocs remaining Dan Carpenter
2009-03-26 14:04   ` btrfs: [patch] remove dead code Dan Carpenter
2009-03-26 14:10   ` [patch] btrfs: " Dan Carpenter
2009-03-26 14:20   ` [patch] btrfs: remove dead code #3 Dan Carpenter
2009-03-26 14:39     ` Jens Axboe
2009-03-26 14:48       ` Chris Mason [this message]
2009-03-26 15:43         ` Jens Axboe
2009-03-26 23:30           ` linux-2.6.29: BUG at fs/btrfs/extent-tree.c:3433 Matteo Frigo

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=1238078881.5676.14.camel@think.oraclecorp.com \
    --to=chris.mason@oracle.com \
    --cc=";;chris.mason"@oracle.com \
    --cc=To-header@kernel.dk \
    --cc=error27@gmail.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=no@kernel.dk \
    --cc=on@kernel.dk \
    /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