提交 24ae6365 编写于 作者: Y Yan, Zheng 提交者: Chris Mason

Btrfs: Fix page leak in compressed writeback path

"start + num_bytes >= actual_end" can happen when compressed page writeback races
with file truncation. In that case we need unlock and release pages past the end
of file.
Signed-off-by: NYan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 84cd948c
......@@ -495,7 +495,7 @@ static noinline int compress_file_range(struct inode *inode,
add_async_extent(async_cow, start, num_bytes,
total_compressed, pages, nr_pages_ret);
if (start + num_bytes < end && start + num_bytes < actual_end) {
if (start + num_bytes < end) {
start += num_bytes;
pages = NULL;
cond_resched();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册