[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160304002954.19844.52266.stgit@maxim-thinkpad>
Date: Thu, 03 Mar 2016 16:30:33 -0800
From: Maxim Patlasov <mpatlasov@...tuozzo.com>
To: hughd@...gle.com
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org, devel@...nvz.org
Subject: [PATCH] tmpfs: shmem_fallocate must return ERESTARTSYS
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@...tuozzo.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
Powered by blists - more mailing lists