summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorZhaolong Zhang <zhangzl2013@126.com>2021-03-02 10:42:31 +0100
committerTheodore Ts'o <tytso@mit.edu>2021-03-06 17:56:11 +0100
commitc915fb80eaa6194fa9bd0a4487705cd5b0dda2f1 (patch)
treed4583347dce3eb48d844fb1aae44eba3655f81a1 /fs/ext4
parentfs/ext4: fix integer overflow in s_log_groups_per_flex (diff)
downloadlinux-c915fb80eaa6194fa9bd0a4487705cd5b0dda2f1.tar.xz
linux-c915fb80eaa6194fa9bd0a4487705cd5b0dda2f1.zip
ext4: fix bh ref count on error paths
__ext4_journalled_writepage should drop bhs' ref count on error paths Signed-off-by: Zhaolong Zhang <zhangzl2013@126.com> Link: https://lore.kernel.org/r/1614678151-70481-1-git-send-email-zhangzl2013@126.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/inode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 650c5acd2f2d..a79a9ea58c56 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1938,13 +1938,13 @@ static int __ext4_journalled_writepage(struct page *page,
if (!ret)
ret = err;
- if (!ext4_has_inline_data(inode))
- ext4_walk_page_buffers(NULL, page_bufs, 0, len,
- NULL, bput_one);
ext4_set_inode_state(inode, EXT4_STATE_JDATA);
out:
unlock_page(page);
out_no_pagelock:
+ if (!inline_data && page_bufs)
+ ext4_walk_page_buffers(NULL, page_bufs, 0, len,
+ NULL, bput_one);
brelse(inode_bh);
return ret;
}