public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Chris Mason <chris.mason@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 16:43:20 +0100	[thread overview]
Message-ID: <20090326154320.GF27476@kernel.dk> (raw)
In-Reply-To: <1238078881.5676.14.camel@think.oraclecorp.com>

On Thu, Mar 26 2009, Chris Mason wrote:
> 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.

Right, it was more a generic comment. As to the memset(), if someone
decided to add a magic to atomic_t or something for debug purposes, it
would break. That's the bigger problem here :-)

-- 
Jens Axboe


  reply	other threads:[~2009-03-26 15:43 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
2009-03-26 15:43         ` Jens Axboe [this message]
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=20090326154320.GF27476@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=";;chris.mason"@oracle.com \
    --cc=To-header@kernel.dk \
    --cc=chris.mason@oracle.com \
    --cc=error27@gmail.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