[PATCH] do_generic_file_read(): Fail immediately if killed

From: Bart Van Assche
Date: Thu Aug 11 2016 - 14:02:29 EST


If a fatal signal has been received, fail immediately instead of
trying to read more data.
---
mm/filemap.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index 20f3b1f..6e46fb5 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1643,7 +1643,12 @@ find_page:
* wait_on_page_locked is used to avoid unnecessarily
* serialisations and why it's safe.
*/
- wait_on_page_locked_killable(page);
+ error = wait_on_page_locked_killable(page);
+ if (error == -EINTR) {
+ put_page(page);
+ goto out;
+ }
+ error = 0;
if (PageUptodate(page))
goto page_ok;

--
2.9.2


--------------1ABB882063EED93AEF250835--