mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luis de Bethencourt <luisbg@osg.samsung.com>
To: Salah Triki <salah.triki@gmail.com>,
	akpm@linux-foundation.org, viro@zeniv.linux.org.uk
Cc: mhocko@suse.com, vdavydov@virtuozzo.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] fs: befs: Remove useless calls to brelse in befs_find_brun_dblindirect
Date: Sat, 02 Jul 2016 12:51:41 +0100	[thread overview]
Message-ID: <5777AACD.4000806@osg.samsung.com> (raw)
In-Reply-To: <dc1f244ff4f9738611e89bd8bad471520d1492e5.1467446561.git.salah.triki@gmail.com>

On 02/07/16 09:05, Salah Triki wrote:
> The calls to brelse are useless since dbl_indir_block and indir_block
> are NULL.
> 
> Signed-off-by: Salah Triki <salah.triki@gmail.com>
> ---
>  fs/befs/datastream.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/fs/befs/datastream.c b/fs/befs/datastream.c
> index e224b9a..b68b6f9 100644
> --- a/fs/befs/datastream.c
> +++ b/fs/befs/datastream.c
> @@ -471,7 +471,6 @@ befs_find_brun_dblindirect(struct super_block *sb,
>  			   (unsigned long)
>  			   iaddr2blockno(sb, &data->double_indirect) +
>  			   dbl_which_block);
> -		brelse(dbl_indir_block);
>  		return BEFS_ERR;
>  	}
>  
> @@ -496,7 +495,6 @@ befs_find_brun_dblindirect(struct super_block *sb,
>  		befs_error(sb, "%s couldn't read the indirect block "
>  			   "at blockno %lu", __func__, (unsigned long)
>  			   iaddr2blockno(sb, &indir_run) + which_block);
> -		brelse(indir_block);
>  		return BEFS_ERR;
>  	}
>  
> 

Great catch!

This went unnoticed because brelse() checks if the buffer_head is NULL before
decrementing the reference count. Which in these two cases they clearly are NULL.

Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com>

Thanks!
Luis

  reply	other threads:[~2016-07-02 11:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-02  8:05 [PATCH 1/4] fs: befs: Remove redundant validation from befs_find_brun_direct Salah Triki
2016-07-02  8:05 ` [PATCH 2/4] fs: befs: Coding style fix Salah Triki
2016-07-02 11:22   ` Luis de Bethencourt
2016-07-02  8:05 ` [PATCH 3/4] fs: befs: Remove useless calls to brelse in befs_find_brun_dblindirect Salah Triki
2016-07-02 11:51   ` Luis de Bethencourt [this message]
2016-07-02  8:05 ` [PATCH 4/4] fs: befs: Remove goto from befs_bread_iaddr Salah Triki
2016-07-02 12:04   ` Luis de Bethencourt
2016-07-02 11:38 ` [PATCH 1/4] fs: befs: Remove redundant validation from befs_find_brun_direct Luis de Bethencourt
2016-07-02 13:34   ` Salah Triki
2016-07-02 14:44     ` Luis de Bethencourt

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=5777AACD.4000806@osg.samsung.com \
    --to=luisbg@osg.samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=salah.triki@gmail.com \
    --cc=vdavydov@virtuozzo.com \
    --cc=viro@zeniv.linux.org.uk \
    /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

Powered by JetHome