public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <esandeen@redhat.com>
To: Lukas Czerner <lczerner@redhat.com>, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext4: Add missing brelse() in add_new_gdb_meta_bg()
Date: Fri, 1 Mar 2019 12:51:38 -0600	[thread overview]
Message-ID: <bc9f3c89-1c9b-5f72-eb72-85b857e1364f@redhat.com> (raw)
In-Reply-To: <20190301171504.8583-1-lczerner@redhat.com>

On 3/1/19 11:15 AM, Lukas Czerner wrote:
> Currently in add_new_gdb_meta_bg() there is a missing brelse of gdb_bh
> in case ext4_journal_get_write_access() fails. Fix it.
> 
> Fixes: 61a9c11e5e7a ("ext4: add missing brelse() add_new_gdb_meta_bg()'s error path")
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>

I'm going to refrain from actual review because I've gotten fairly
far away from ext4 code, but OTOH I did bring this question to Lukas,
so I'd also like to ask whether this error handling is problematic
in several other callsites... my meager pattern recognition skills
while looking over the code make me go "hmmmm...." a little but
I may well be missing the big picture of how these buffer heads
are managed.

Thanks,
-Eric


> ---
>  fs/ext4/resize.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
> index 48421de803b7..e945f412cf58 100644
> --- a/fs/ext4/resize.c
> +++ b/fs/ext4/resize.c
> @@ -937,6 +937,8 @@ static int add_new_gdb_meta_bg(struct super_block *sb,
>  	kvfree(o_group_desc);
>  	BUFFER_TRACE(gdb_bh, "get_write_access");
>  	err = ext4_journal_get_write_access(handle, gdb_bh);
> +	if (err)
> +		brelse(gdb_bh);
>  	return err;
>  }
>  
> 

  reply	other threads:[~2019-03-01 18:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01 17:15 [PATCH] ext4: Add missing brelse() in add_new_gdb_meta_bg() Lukas Czerner
2019-03-01 18:51 ` Eric Sandeen [this message]
2019-03-03  2:07 ` Theodore Y. Ts'o
2019-03-04 12:23   ` Lukas Czerner

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=bc9f3c89-1c9b-5f72-eb72-85b857e1364f@redhat.com \
    --to=esandeen@redhat.com \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.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