public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Peter Pan <wppan@redflag-linux.com>
Cc: jack@suse.cz, hch@lst.de, viro@zeniv.linux.org.uk,
	npiggin@suse.de, jblunck@suse.de, linux-fsdevel@vger.kernel.org,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] ext2:delete misused ext2_free_blocks
Date: Thu, 1 Jul 2010 00:57:54 +0200	[thread overview]
Message-ID: <20100630225754.GT19184@bicker> (raw)
In-Reply-To: <1277893287-25916-1-git-send-email-wppan@redflag-linux.com>

On Wed, Jun 30, 2010 at 06:21:27PM +0800, Peter Pan wrote:
> if ext2_new_blocks returns error, no blocks need to be freed.
> 

Hi Peter,

Your patch isn't right.  The original code is OK as is.

Are you seeing a kernel panic?  Perhaps we can help you fix it.

regards,
dan carpenter

> Signed-off-by: Peter Pan <wppan@redflag-linux.com>
> ---
>  fs/ext2/inode.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
> index 3675088..f858847 100644
> --- a/fs/ext2/inode.c
> +++ b/fs/ext2/inode.c
> @@ -385,6 +385,8 @@ static int ext2_alloc_blocks(struct inode *inode,
>  	ext2_fsblk_t current_block = 0;
>  	int ret = 0;
>  
> +	*err = -ENOSPC;
> +
>  	/*
>  	 * Here we try to allocate the requested multiple blocks at once,
>  	 * on a best-effort basis.
> @@ -421,8 +423,6 @@ static int ext2_alloc_blocks(struct inode *inode,
>  	*err = 0;
>  	return ret;
>  failed_out:
> -	for (i = 0; i <index; i++)
> -		ext2_free_blocks(inode, new_blocks[i], 1);
>  	return ret;
>  }
>  
> -- 
> 1.6.6

       reply	other threads:[~2010-06-30 22:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1277893287-25916-1-git-send-email-wppan@redflag-linux.com>
2010-06-30 22:57 ` Dan Carpenter [this message]
2010-07-01  1:56   ` [PATCH] ext2:delete misused ext2_free_blocks Peter Pan

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=20100630225754.GT19184@bicker \
    --to=error27@gmail.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=jblunck@suse.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npiggin@suse.de \
    --cc=viro@zeniv.linux.org.uk \
    --cc=wppan@redflag-linux.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