public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Dan Carpenter <error27@gmail.com>
Cc: unlisted-recipients: no@kernel.dk, To-header@kernel.dk,
	on@kernel.dk, "input <"@kernel.dk, ; chris.mason@oracle.com,
	linux-btrfs@vger.kernel.org
Subject: Re: [patch] btrfs: remove dead code #3
Date: Thu, 26 Mar 2009 15:39:36 +0100	[thread overview]
Message-ID: <20090326143936.GE27476@kernel.dk> (raw)
In-Reply-To: <Pine.LNX.4.64.0903261716270.1976@usbsys.site>

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.

-- 
Jens Axboe


  reply	other threads:[~2009-03-26 14:39 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 [this message]
2009-03-26 14:48       ` Chris Mason
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=20090326143936.GE27476@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc="input <"@kernel.dk \
    --cc=To-header@kernel.dk \
    --cc=error27@gmail.com \
    --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