Skip to content

Commit

Permalink
ext4: fix bh ref count on error paths
Browse files Browse the repository at this point in the history
[ Upstream commit c915fb8 ]

__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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
zhangzl2013 authored and gregkh committed Apr 7, 2021
1 parent 4b31395 commit e178f36
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/ext4/inode.c
Expand Up @@ -1937,13 +1937,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;
}
Expand Down

0 comments on commit e178f36

Please sign in to comment.