Patchwork ext3: remove an unneeded check in ext3_new_blocks()

login
register
mail settings
Submitter Dan Carpenter
Date Feb. 25, 2014, 8:39 a.m.
Message ID <20140225083945.GC5023@elgon.mountain>
Download mbox | patch
Permalink /patch/323860/
State Not Applicable
Headers show

Comments

Dan Carpenter - Feb. 25, 2014, 8:39 a.m.
We know "fatal" is zero here.  The code can be simplified a bit by
assigning directly.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jan Kara - Feb. 25, 2014, 9:49 a.m.
On Tue 25-02-14 11:39:45, Dan Carpenter wrote:
> We know "fatal" is zero here.  The code can be simplified a bit by
> assigning directly.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
  Thanks. Added to my tree.

								Honza

> 
> diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
> index 22548f56197b..158b5d4ce067 100644
> --- a/fs/ext3/balloc.c
> +++ b/fs/ext3/balloc.c
> @@ -1727,10 +1727,7 @@ allocated:
>  	percpu_counter_sub(&sbi->s_freeblocks_counter, num);
>  
>  	BUFFER_TRACE(gdp_bh, "journal_dirty_metadata for group descriptor");
> -	err = ext3_journal_dirty_metadata(handle, gdp_bh);
> -	if (!fatal)
> -		fatal = err;
> -
> +	fatal = ext3_journal_dirty_metadata(handle, gdp_bh);
>  	if (fatal)
>  		goto out;
>

Patch

diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
index 22548f56197b..158b5d4ce067 100644
--- a/fs/ext3/balloc.c
+++ b/fs/ext3/balloc.c
@@ -1727,10 +1727,7 @@  allocated:
 	percpu_counter_sub(&sbi->s_freeblocks_counter, num);
 
 	BUFFER_TRACE(gdp_bh, "journal_dirty_metadata for group descriptor");
-	err = ext3_journal_dirty_metadata(handle, gdp_bh);
-	if (!fatal)
-		fatal = err;
-
+	fatal = ext3_journal_dirty_metadata(handle, gdp_bh);
 	if (fatal)
 		goto out;