提交 e55f1a18 编写于 作者: N NeilBrown 提交者: Ilya Dryomov

ceph: remove warning when ceph_releasepage() is called on dirty page

If O_DIRECT writes are racing with buffered writes, then
the call to invalidate_inode_pages2_range() can call ceph_releasepage()
on dirty pages.

Most filesystems hold inode_lock() across O_DIRECT writes so they do not
suffer this race, but cephfs deliberately drops the lock, and opens a window
for the race.

This race can be triggered with the generic/036 test from the xfstests
test suite.  It doesn't happen every time, but it does happen often.

As the possibilty is expected, remove the warning, and instead include
the PageDirty() status in the debug message.
Signed-off-by: NNeilBrown <neilb@suse.com>
Reviewed-by: NJeff Layton <jlayton@redhat.com>
Reviewed-by: NYan, Zheng <zyan@redhat.com>
上级 5d7eb1a3
...@@ -175,9 +175,8 @@ static void ceph_invalidatepage(struct page *page, unsigned int offset, ...@@ -175,9 +175,8 @@ static void ceph_invalidatepage(struct page *page, unsigned int offset,
static int ceph_releasepage(struct page *page, gfp_t g) static int ceph_releasepage(struct page *page, gfp_t g)
{ {
dout("%p releasepage %p idx %lu\n", page->mapping->host, dout("%p releasepage %p idx %lu (%sdirty)\n", page->mapping->host,
page, page->index); page, page->index, PageDirty(page) ? "" : "not ");
WARN_ON(PageDirty(page));
/* Can we release the page from the cache? */ /* Can we release the page from the cache? */
if (!ceph_release_fscache_page(page, g)) if (!ceph_release_fscache_page(page, g))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册