From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Marc Dionne <marc.dionne@auristor.com>,
David Howells <dhowells@redhat.com>,
Jeff Layton <jlayton@redhat.com>,
Al Viro <viro@zeniv.linux.org.uk>
Subject: [PATCH 4.4 07/22] fscache: Fix the default for fscache_maybe_release_page()
Date: Mon, 8 Jan 2018 13:59:34 +0100 [thread overview]
Message-ID: <20180108125925.913263821@linuxfoundation.org> (raw)
In-Reply-To: <20180108125925.601688333@linuxfoundation.org>
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <dhowells@redhat.com>
commit 98801506552593c9b8ac11021b0cdad12cab4f6b upstream.
Fix the default for fscache_maybe_release_page() for when the cookie isn't
valid or the page isn't cached. It mustn't return false as that indicates
the page cannot yet be freed.
The problem with the default is that if, say, there's no cache, but a
network filesystem's pages are using up almost all the available memory, a
system can OOM because the filesystem ->releasepage() op will not allow
them to be released as fscache_maybe_release_page() incorrectly prevents
it.
This can be tested by writing a sequence of 512MiB files to an AFS mount.
It does not affect NFS or CIFS because both of those wrap the call in a
check of PG_fscache and it shouldn't bother Ceph as that only has
PG_private set whilst writeback is in progress. This might be an issue for
9P, however.
Note that the pages aren't entirely stuck. Removing a file or unmounting
will clear things because that uses ->invalidatepage() instead.
Fixes: 201a15428bd5 ("FS-Cache: Handle pages pending storage that get evicted under OOM conditions")
Reported-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/fscache.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/include/linux/fscache.h
+++ b/include/linux/fscache.h
@@ -764,7 +764,7 @@ bool fscache_maybe_release_page(struct f
{
if (fscache_cookie_valid(cookie) && PageFsCache(page))
return __fscache_maybe_release_page(cookie, page, gfp);
- return false;
+ return true;
}
/**
next prev parent reply other threads:[~2018-01-08 12:59 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-08 12:59 [PATCH 4.4 00/22] 4.4.111-stable review Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 01/22] x86/kasan: Write protect kasan zero shadow Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 02/22] kernel/acct.c: fix the acct->needcheck check in check_free_space() Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 03/22] crypto: n2 - cure use after free Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 04/22] crypto: chacha20poly1305 - validate the digest size Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 05/22] crypto: pcrypt - fix freeing pcrypt instances Greg Kroah-Hartman
2018-01-08 12:59 ` Greg Kroah-Hartman [this message]
2018-01-08 12:59 ` [PATCH 4.4 08/22] kernel: make groups_sort calling a responsibility group_info allocators Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 09/22] kernel/signal.c: protect the traced SIGNAL_UNKILLABLE tasks from SIGKILL Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 10/22] kernel/signal.c: protect the SIGNAL_UNKILLABLE tasks from !sig_kernel_only() signals Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 11/22] kernel/signal.c: remove the no longer needed SIGNAL_UNKILLABLE check in complete_signal() Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 12/22] ARC: uaccess: dont use "l" gcc inline asm constraint modifier Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 13/22] Input: elantech - add new icbody type 15 Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 14/22] x86/microcode/AMD: Add support for fam17h microcode loading Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 15/22] parisc: Fix alignment of pa_tlb_lock in assembly on 32-bit SMP kernel Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 17/22] x86/tlb: Drop the _GPL from the cpu_tlbstate export Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 18/22] genksyms: Handle string literals with spaces in reference files Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 19/22] module: keep percpu symbols in modules symtab Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 20/22] module: Issue warnings when tainting kernel Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 21/22] proc: much faster /proc/vmstat Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.4 22/22] Map the vsyscall page with _PAGE_USER Greg Kroah-Hartman
2018-01-08 14:25 ` [PATCH 4.4 00/22] 4.4.111-stable review Nathan Chancellor
2018-01-08 16:32 ` Greg Kroah-Hartman
2018-01-08 15:21 ` 王金浦
2018-01-08 16:32 ` Greg Kroah-Hartman
2018-01-08 17:29 ` Christoph Biedl
2018-01-08 17:44 ` Borislav Petkov
2018-01-08 21:00 ` Shuah Khan
2018-01-08 23:29 ` Guenter Roeck
2018-01-09 9:13 ` Greg Kroah-Hartman
2018-01-09 9:23 ` Greg Kroah-Hartman
2018-01-09 13:50 ` Guenter Roeck
2018-01-09 9:51 ` Naresh Kamboju
2018-01-09 10:50 ` Greg Kroah-Hartman
2018-01-09 16:16 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180108125925.913263821@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=dhowells@redhat.com \
--cc=jlayton@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.dionne@auristor.com \
--cc=stable@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).