* [PATCH] ext4: fix bh ref count on error paths
@ 2021-03-02 9:42 Zhaolong Zhang
2021-03-05 14:39 ` Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Zhaolong Zhang @ 2021-03-02 9:42 UTC (permalink / raw)
To: Theodore Ts'o, Andreas Dilger
Cc: linux-ext4, linux-kernel, Zhaolong Zhang
__ext4_journalled_writepage should drop bhs' ref count on error paths
Signed-off-by: Zhaolong Zhang <zhangzl2013@126.com>
---
fs/ext4/inode.c | 6 +++---
1 file 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;
}
--
2.26.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ext4: fix bh ref count on error paths
2021-03-02 9:42 [PATCH] ext4: fix bh ref count on error paths Zhaolong Zhang
@ 2021-03-05 14:39 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2021-03-05 14:39 UTC (permalink / raw)
To: Zhaolong Zhang; +Cc: Andreas Dilger, linux-ext4, linux-kernel
On Tue, Mar 02, 2021 at 05:42:31PM +0800, Zhaolong Zhang wrote:
> __ext4_journalled_writepage should drop bhs' ref count on error paths
>
> Signed-off-by: Zhaolong Zhang <zhangzl2013@126.com>
Thanks, applied.
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-05 14:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02 9:42 [PATCH] ext4: fix bh ref count on error paths Zhaolong Zhang
2021-03-05 14:39 ` Theodore Ts'o
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.