diff options
author | Vasily Averin <vvs@virtuozzo.com> | 2018-11-06 16:49:50 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2018-11-06 16:49:50 -0500 |
commit | a6758309a005060b8297a538a457c88699cb2520 (patch) | |
tree | 8f89089a3a8fe39b651a9d77c53fb31e506e5728 | |
parent | db6aee62406d9fbb53315fcddd81f1dc271d49fa (diff) |
ext4: avoid buffer leak on shutdown in ext4_mark_iloc_dirty()
ext4_mark_iloc_dirty() callers expect that it releases iloc->bh
even if it returns an error.
Fixes: 0db1ff222d40 ("ext4: add shutdown bit and check for it")
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org # 4.11
-rw-r--r-- | fs/ext4/inode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index c3d9a42c561e..55c8fca76daf 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -5835,9 +5835,10 @@ int ext4_mark_iloc_dirty(handle_t *handle, | |||
5835 | { | 5835 | { |
5836 | int err = 0; | 5836 | int err = 0; |
5837 | 5837 | ||
5838 | if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) | 5838 | if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) { |
5839 | put_bh(iloc->bh); | ||
5839 | return -EIO; | 5840 | return -EIO; |
5840 | 5841 | } | |
5841 | if (IS_I_VERSION(inode)) | 5842 | if (IS_I_VERSION(inode)) |
5842 | inode_inc_iversion(inode); | 5843 | inode_inc_iversion(inode); |
5843 | 5844 | ||