“59b435a508d0f0661ad16097b785e1a53342ad98”上不存在“test/javax/git@gitcode.net:openanolis/dragonwell8_jdk.git”
提交 c802a2c1 编写于 作者: A Andreas Gruenbacher 提交者: Jialin Zhang

iomap: Don't create iomap_page objects for inline files

mainline inclusion
from mainline-v5.14-rc2
commit 637d3375
category: bugfix
bugzilla: 188764, https://gitee.com/openeuler/kernel/issues/I736LW

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=637d3375953e052a62c0db409557e3b3354be88a

--------------------------------

In iomap_readpage_actor, don't create iop objects for inline inodes.
Otherwise, iomap_read_inline_data will set PageUptodate without setting
iop->uptodate, and iomap_page_release will eventually complain.

To prevent this kind of bug from occurring in the future, make sure the
page doesn't have private data attached in iomap_read_inline_data.
Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NDarrick J. Wong <djwong@kernel.org>
Signed-off-by: NDarrick J. Wong <djwong@kernel.org>
Signed-off-by: NBaokun Li <libaokun1@huawei.com>
Reviewed-by: NYang Erkun <yangerkun@huawei.com>
Reviewed-by: NZhang Yi <yi.zhang@huawei.com>
Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com>
上级 5b884f7c
...@@ -217,6 +217,7 @@ iomap_read_inline_data(struct inode *inode, struct page *page, ...@@ -217,6 +217,7 @@ iomap_read_inline_data(struct inode *inode, struct page *page,
if (PageUptodate(page)) if (PageUptodate(page))
return; return;
BUG_ON(page_has_private(page));
BUG_ON(page->index); BUG_ON(page->index);
BUG_ON(size > PAGE_SIZE - offset_in_page(iomap->inline_data)); BUG_ON(size > PAGE_SIZE - offset_in_page(iomap->inline_data));
...@@ -241,7 +242,7 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data, ...@@ -241,7 +242,7 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
{ {
struct iomap_readpage_ctx *ctx = data; struct iomap_readpage_ctx *ctx = data;
struct page *page = ctx->cur_page; struct page *page = ctx->cur_page;
struct iomap_page *iop = iomap_page_create(inode, page); struct iomap_page *iop;
bool same_page = false, is_contig = false; bool same_page = false, is_contig = false;
loff_t orig_pos = pos; loff_t orig_pos = pos;
unsigned poff, plen; unsigned poff, plen;
...@@ -254,6 +255,7 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data, ...@@ -254,6 +255,7 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
} }
/* zero post-eof blocks as the page may be mapped */ /* zero post-eof blocks as the page may be mapped */
iop = iomap_page_create(inode, page);
iomap_adjust_read_range(inode, iop, &pos, length, &poff, &plen); iomap_adjust_read_range(inode, iop, &pos, length, &poff, &plen);
if (plen == 0) if (plen == 0)
goto done; goto done;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册