From: Maxim Patlasov <mpatlasov@virtuozzo.com>
To: hughd@google.com
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, devel@openvz.org
Subject: [PATCH] tmpfs: shmem_fallocate must return ERESTARTSYS
Date: Thu, 03 Mar 2016 16:30:33 -0800 [thread overview]
Message-ID: <20160304002954.19844.52266.stgit@maxim-thinkpad> (raw)
shmem_fallocate() is restartable, so it can return ERESTARTSYS if
signal_pending(). Although fallocate(2) manpage permits EINTR,
the more places use ERESTARTSYS the better.
Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
---
mm/shmem.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index 440e2a7..60e9c8a 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2229,11 +2229,13 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset,
struct page *page;
/*
- * Good, the fallocate(2) manpage permits EINTR: we may have
- * been interrupted because we are using up too much memory.
+ * Although fallocate(2) manpage permits EINTR, the more
+ * places use ERESTARTSYS the better. If we have been
+ * interrupted because we are using up too much memory,
+ * oom-killer used fatal signal and we will die anyway.
*/
if (signal_pending(current))
- error = -EINTR;
+ error = -ERESTARTSYS;
else if (shmem_falloc.nr_unswapped > shmem_falloc.nr_falloced)
error = -ENOMEM;
else
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2016-03-04 0:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-04 0:30 Maxim Patlasov [this message]
2016-03-04 0:44 ` Mike Kravetz
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=20160304002954.19844.52266.stgit@maxim-thinkpad \
--to=mpatlasov@virtuozzo.com \
--cc=devel@openvz.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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