linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vasily Averin <vvs@virtuozzo.com>
To: linux-ext4@vger.kernel.org, Theodore Ts'o <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>, linux-kernel@vger.kernel.org
Subject: [PATCH 7/7] ext4: lost brelse in ext4_expand_extra_isize_ea()
Date: Wed, 31 Oct 2018 22:13:09 +0300	[thread overview]
Message-ID: <c5dc2118-ac42-c899-f218-4a78aa39c37f@virtuozzo.com> (raw)
In-Reply-To: <cover.1541011937.git.vvs@virtuozzo.com>

Fixes de05ca852679 ("ext4: move call to ext4_error() into ...") # 4.17

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 fs/ext4/xattr.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index 5c9bc0d85cc0..0b9688683526 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -2698,7 +2698,6 @@ int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize,
 			       struct ext4_inode *raw_inode, handle_t *handle)
 {
 	struct ext4_xattr_ibody_header *header;
-	struct buffer_head *bh;
 	struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
 	static unsigned int mnt_count;
 	size_t min_offs;
@@ -2739,13 +2738,17 @@ int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize,
 	 * EA block can hold new_extra_isize bytes.
 	 */
 	if (EXT4_I(inode)->i_file_acl) {
+		struct buffer_head *bh;
+
 		bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl);
 		error = -EIO;
 		if (!bh)
 			goto cleanup;
 		error = ext4_xattr_check_block(inode, bh);
-		if (error)
+		if (error) {
+			brelse(bh);
 			goto cleanup;
+		}
 		base = BHDR(bh);
 		end = bh->b_data + bh->b_size;
 		min_offs = end - base;
-- 
2.17.1


  parent reply	other threads:[~2018-10-31 19:13 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
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 ` Vasily Averin [this message]
2018-11-08  3:22   ` [PATCH 7/7] ext4: lost brelse in ext4_expand_extra_isize_ea() 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=c5dc2118-ac42-c899-f218-4a78aa39c37f@virtuozzo.com \
    --to=vvs@virtuozzo.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).