summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasily Averin <vvs@virtuozzo.com>2018-11-06 16:20:40 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-21 09:27:43 +0100
commit36ab0ab9b88d85fcb7b6a86db4b13cbbd52c208a (patch)
treec72596a9077e1d127e3db8c8f855c880521493cc
parentd507dfb5e4fe3e5b01259055c7a4fcaba114f89e (diff)
downloadlinux-stable-36ab0ab9b88d85fcb7b6a86db4b13cbbd52c208a.tar.gz
linux-stable-36ab0ab9b88d85fcb7b6a86db4b13cbbd52c208a.tar.bz2
linux-stable-36ab0ab9b88d85fcb7b6a86db4b13cbbd52c208a.zip
ext4: fix possible inode leak in the retry loop of ext4_resize_fs()
commit db6aee62406d9fbb53315fcddd81f1dc271d49fa upstream. Fixes: 1c6bd7173d66 ("ext4: convert file system to meta_bg if needed ...") Signed-off-by: Vasily Averin <vvs@virtuozzo.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 3.7 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/ext4/resize.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 37f275375089..52c28d37112e 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -2026,6 +2026,10 @@ retry:
n_blocks_count_retry = 0;
free_flex_gd(flex_gd);
flex_gd = NULL;
+ if (resize_inode) {
+ iput(resize_inode);
+ resize_inode = NULL;
+ }
goto retry;
}