Commit c915fb80 authored by Zhaolong Zhang's avatar Zhaolong Zhang Committed by Theodore Ts'o

ext4: fix bh ref count on error paths

__ext4_journalled_writepage should drop bhs' ref count on error paths
Signed-off-by: default avatarZhaolong Zhang <zhangzl2013@126.com>
Link: https://lore.kernel.org/r/1614678151-70481-1-git-send-email-zhangzl2013@126.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent f91436d5
...@@ -1938,13 +1938,13 @@ static int __ext4_journalled_writepage(struct page *page, ...@@ -1938,13 +1938,13 @@ static int __ext4_journalled_writepage(struct page *page,
if (!ret) if (!ret)
ret = err; 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); ext4_set_inode_state(inode, EXT4_STATE_JDATA);
out: out:
unlock_page(page); unlock_page(page);
out_no_pagelock: out_no_pagelock:
if (!inline_data && page_bufs)
ext4_walk_page_buffers(NULL, page_bufs, 0, len,
NULL, bput_one);
brelse(inode_bh); brelse(inode_bh);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment