linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Vasily Averin <vvs@virtuozzo.com>
Cc: linux-ext4@vger.kernel.org,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/7] ext4: lost brelse in __ext4_read_dirblock()
Date: Wed, 7 Nov 2018 10:25:49 -0500	[thread overview]
Message-ID: <20181107152549.GB9919@thunk.org> (raw)
In-Reply-To: <60f19df8-1e65-99a0-cb6b-696d1b530fd4@virtuozzo.com>

On Wed, Oct 31, 2018 at 10:12:18PM +0300, Vasily Averin wrote:
> Fixes dc6982ff4db1 ("ext4: refactor code to read directory blocks ...") # 3.9
> 
> Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
> ---
>  fs/ext4/namei.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
> index d388cce72db2..1a21e59ede72 100644
> --- a/fs/ext4/namei.c
> +++ b/fs/ext4/namei.c
> @@ -111,6 +111,7 @@ static struct buffer_head *__ext4_read_dirblock(struct inode *inode,
>  	if (!bh) {
>  		ext4_error_inode(inode, func, line, block,
>  				 "Directory hole found");
> +		brelse(bh);
>  		return ERR_PTR(-EFSCORRUPTED);
>  	}
>  	dirent = (struct ext4_dir_entry *) bh->b_data;

Inside the conditional, bh == NULL, so the brelse isn't needed.

Cheers,

						- Ted

  reply	other threads:[~2018-11-07 15:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1541011937.git.vvs@virtuozzo.com>
2018-10-31 19:12 ` [PATCH 1/7] ext4: lost brelse in __ext4_read_dirblock() Vasily Averin
2018-11-07 15:25   ` Theodore Y. Ts'o [this message]
2018-11-07 17:18     ` Vasily Averin
2018-11-07 17:30       ` [PATCH v2] " Vasily Averin
2018-11-08  3:38         ` Theodore Y. Ts'o
2018-10-31 19:12 ` [PATCH 2/7] ext4: possible sbi->s_group_desc leak in ext4_fill_super Vasily Averin
2018-11-07 15:33   ` Theodore Y. Ts'o
2018-10-31 19:12 ` [PATCH 3/7] ext4: lost release of s_journal_flag_rwsem on rollback " Vasily Averin
2018-11-07 15:57   ` Theodore Y. Ts'o
2018-10-31 19:12 ` [PATCH 4/7] ext4: lost brelse in ext4_xattr_get_block() Vasily Averin
2018-11-07 16:02   ` Theodore Y. Ts'o
2018-10-31 19:12 ` [PATCH 5/7] ext4: bs.bh cleanup before re-using in ext4_xattr_block_find() Vasily Averin
2018-11-07 16:08   ` Theodore Y. Ts'o
2018-10-31 19:13 ` [PATCH 6/7] ext4: lost brelse in ext4_xattr_move_to_block() Vasily Averin
2018-11-07 13:50   ` Jan Kara
2018-11-07 16:11     ` Theodore Y. Ts'o
2018-10-31 19:13 ` [PATCH 7/7] ext4: lost brelse in ext4_expand_extra_isize_ea() Vasily Averin
2018-11-08  3:22   ` Theodore Y. Ts'o

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=20181107152549.GB9919@thunk.org \
    --to=tytso@mit.edu \
    --cc=adilger.kernel@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vvs@virtuozzo.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;
as well as URLs for NNTP newsgroup(s).