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 v2 09/11] ext4: iloc.bh cleanup in add_new_gdb()
Date: Tue, 6 Nov 2018 17:19:05 -0500 [thread overview]
Message-ID: <20181106221905.GH2570@thunk.org> (raw)
In-Reply-To: <eb58c8ca-8456-7b5f-9c12-99f03e3057af@virtuozzo.com>
On Wed, Oct 31, 2018 at 12:58:38AM +0300, Vasily Averin wrote:
> iloc.bh was taken in ext4_reserve_inode_write() and released
> in ext4_mark_iloc_dirty(). It should not be released 2nd time
> in rollback after failed ext4_handle_dirty_metadata(gdb_bh)
>
> Fixes b40971426a83 ("ext4: add error checking to calls to ...") # 2.6.38
>
> Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
I fixed this in a simpler way:
>From 6a91a2eb1c5af1381caebfb4c1c91dc175351f6f Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <tytso@mit.edu>
Date: Tue, 6 Nov 2018 17:18:17 -0500
Subject: [PATCH] ext4: avoid possible double brelse() in add_new_gdb() on
error path
Fixes: b40971426a83 ("ext4: add error checking to calls to ...")
Reported-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org # 2.6.38
---
fs/ext4/resize.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 85158e9de7c2..a5efee34415f 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -871,6 +871,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
err = ext4_handle_dirty_metadata(handle, NULL, gdb_bh);
if (unlikely(err)) {
ext4_std_error(sb, err);
+ iloc.bh = NULL;
goto exit_inode;
}
brelse(dind);
--
2.18.0.rc0
next prev parent reply other threads:[~2018-11-07 7:46 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1540935522.git.vvs@virtuozzo.com>
2018-10-30 21:57 ` [PATCH v2 01/11] ext4 resise: extra brelse in setup_new_flex_group_blocks() Vasily Averin
2018-11-03 20:20 ` Theodore Y. Ts'o
2018-10-30 21:57 ` [PATCH v2 02/11] ext4 resize: missing brelse() after errors in set_flexbg_block_bitmap() Vasily Averin
2018-11-03 20:28 ` Theodore Y. Ts'o
2018-10-30 21:57 ` [PATCH v2 03/11] ext4 resize: brelse() cleanup in add_new_gdb_meta_bg() Vasily Averin
2018-11-03 20:55 ` Theodore Y. Ts'o
2018-10-30 21:58 ` [PATCH v2 04/11] ext4 resize: lost brelse() in update_backups() Vasily Averin
2018-11-03 21:14 ` Theodore Y. Ts'o
2018-10-30 21:58 ` [PATCH v2 05/11] ext4 resize: lost rollback in ext4_resize_fs() Vasily Averin
2018-11-06 21:17 ` Theodore Y. Ts'o
2018-10-30 21:58 ` [PATCH v2 06/11] ext4 resize: lost resize_inode cleanup before retry " Vasily Averin
2018-11-06 21:23 ` Theodore Y. Ts'o
2018-10-30 21:58 ` [PATCH v2 07/11] ext4: lost put_bh in ext4_mark_iloc_dirty() Vasily Averin
2018-11-06 21:53 ` Theodore Y. Ts'o
2018-10-30 21:58 ` [PATCH v2 08/11] ext4: lost brelse in ext4_orphan_add() Vasily Averin
2018-11-06 22:04 ` Theodore Y. Ts'o
2018-10-30 21:58 ` [PATCH v2 09/11] ext4: iloc.bh cleanup in add_new_gdb() Vasily Averin
2018-11-06 22:19 ` Theodore Y. Ts'o [this message]
2018-10-30 21:58 ` [PATCH v2 10/11] ext4: remove useless brelse call in ext4_xattr_inode_update_ref() Vasily Averin
2018-11-06 22:49 ` Theodore Y. Ts'o
2018-10-30 21:58 ` [PATCH v2 11/11] ext4: access to uninitialized bh fields in ext4_xattr_set_handle() Vasily Averin
[not found] ` <48BA929C-9BF7-4092-BDD3-BECB64AF0599@dilger.ca>
2018-10-31 3:39 ` Vasily Averin
2018-11-01 0:42 ` Andreas Dilger
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=20181106221905.GH2570@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).