Skip to content

Commit c915fb8

Browse files
zhangzl2013tytso
authored andcommitted
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>
1 parent f91436d commit c915fb8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

fs/ext4/inode.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,13 +1938,13 @@ static int __ext4_journalled_writepage(struct page *page,
19381938
if (!ret)
19391939
ret = err;
19401940

1941-
if (!ext4_has_inline_data(inode))
1942-
ext4_walk_page_buffers(NULL, page_bufs, 0, len,
1943-
NULL, bput_one);
19441941
ext4_set_inode_state(inode, EXT4_STATE_JDATA);
19451942
out:
19461943
unlock_page(page);
19471944
out_no_pagelock:
1945+
if (!inline_data && page_bufs)
1946+
ext4_walk_page_buffers(NULL, page_bufs, 0, len,
1947+
NULL, bput_one);
19481948
brelse(inode_bh);
19491949
return ret;
19501950
}

0 commit comments

Comments
 (0)