fscache: Fix hanging wait on page discarded by writeback
authorDavid Howells <dhowells@redhat.com>
Wed, 4 Apr 2018 12:41:26 +0000 (13:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 05:52:25 +0000 (07:52 +0200)
commit22f1bde5d1bf2950b749808483d8c929aff5d17e
tree38f281c8c46e13ad57f22730017aedf78170cfea
parent6d03ff166926c7b0d70b6184bb694d684e23f6b5
fscache: Fix hanging wait on page discarded by writeback

[ Upstream commit 2c98425720233ae3e135add0c7e869b32913502f ]

If the fscache asynchronous write operation elects to discard a page that's
pending storage to the cache because the page would be over the store limit
then it needs to wake the page as someone may be waiting on completion of
the write.

The problem is that the store limit may be updated by a different
asynchronous operation - and so may miss the write - and that the store
limit may not even get updated until later by the netfs.

Fix the kernel hang by making fscache_write_op() mark as written any pages
that are over the limit.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/fscache/page.c