linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] shmem: fix faulting into a hole, not taking i_mutex: fix
@ 2014-07-23  0:01 Hugh Dickins
  0 siblings, 0 replies; only message in thread
From: Hugh Dickins @ 2014-07-23  0:01 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Sasha Levin, Vlastimil Babka, Konstantin Khlebnikov,
	Johannes Weiner, Michel Lespinasse, Lukas Czerner, Dave Jones,
	linux-mm, linux-fsdevel, linux-kernel

Sasha reports various nasty trinity crashes when shmem_fault() tries
to finish_wait(), we guess from rare cases when the wait_queue_head
on shmem_fallocate()'s stack has already gone.  Fix those by using
TASK_UNINTERRUPIBLE instead of TASK_KILLABLE in prepare_to_wait(),
that's much simpler and safer: TASK_KILLABLE was a nice aspiration,
but not worth any more hassle.

Reported-and-tested-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Hugh Dickins <hughd@google.com>
---
Andrew, please fold this into
shmem-fix-faulting-into-a-hole-not-taking-i_mutex.patch
before sending the fixes on to Linus - thanks.

 mm/shmem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- mmotm/mm/shmem.c	2014-07-22 16:35:49.683985586 -0700
+++ linux/mm/shmem.c	2014-07-22 16:36:35.459984108 -0700
@@ -1283,7 +1283,7 @@ static int shmem_fault(struct vm_area_st
 
 			shmem_falloc_waitq = shmem_falloc->waitq;
 			prepare_to_wait(shmem_falloc_waitq, &shmem_fault_wait,
-					TASK_KILLABLE);
+					TASK_UNINTERRUPTIBLE);
 			spin_unlock(&inode->i_lock);
 			schedule();

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-23  0:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-23  0:01 [PATCH] shmem: fix faulting into a hole, not taking i_mutex: fix Hugh Dickins

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).