diff options
author | NeilBrown <neilb@suse.com> | 2016-08-31 05:59:29 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2016-10-03 17:13:49 +0300 |
commit | e55f1a1871b148802b42ee3807edcb6528ffc27d (patch) | |
tree | c83984f65cf1fd3dbe84d17165c17d35602813cb | |
parent | 5d7eb1a3225309b294275385ece36fee256d5c46 (diff) | |
download | linux-e55f1a1871b148802b42ee3807edcb6528ffc27d.tar.xz |
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: NeilBrown <neilb@suse.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Yan, Zheng <zyan@redhat.com>
-rw-r--r-- | fs/ceph/addr.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index f410a0cb57e3..ef3ebd780aff 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -175,9 +175,8 @@ static void ceph_invalidatepage(struct page *page, unsigned int offset, static int ceph_releasepage(struct page *page, gfp_t g) { - dout("%p releasepage %p idx %lu\n", page->mapping->host, - page, page->index); - WARN_ON(PageDirty(page)); + dout("%p releasepage %p idx %lu (%sdirty)\n", page->mapping->host, + page, page->index, PageDirty(page) ? "" : "not "); /* Can we release the page from the cache? */ if (!ceph_release_fscache_page(page, g)) |