linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tmpfs: fix highmem swapoff crash regression
@ 2011-05-20 22:47 Hugh Dickins
  0 siblings, 0 replies; only message in thread
From: Hugh Dickins @ 2011-05-20 22:47 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Andrew Morton, Witold Baryluk, Nitin Gupta,
	Konstantin Khlebnikov, linux-kernel, linux-mm

Commit 778dd893ae78 "tmpfs: fix race between umount and swapoff"
forgot the new rules for strict atomic kmap nesting, causing
WARNING: at arch/x86/mm/highmem_32.c:81 from __kunmap_atomic(), then
BUG: unable to handle kernel paging request at fffb9000 from shmem_swp_set()
when shmem_unuse_inode() is handling swapoff with highmem in use.
My disgrace again.  See https://bugzilla.kernel.org/show_bug.cgi?id=35352

Reported-by: Witold Baryluk <baryluk@smp.if.uj.edu.pl>
Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: stable@kernel.org
---

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

--- 2.6.39/mm/shmem.c	2011-05-18 21:06:34.000000000 -0700
+++ linux/mm/shmem.c	2011-05-20 13:57:20.778870967 -0700
@@ -916,11 +916,12 @@ static int shmem_unuse_inode(struct shme
 			if (size > ENTRIES_PER_PAGE)
 				size = ENTRIES_PER_PAGE;
 			offset = shmem_find_swp(entry, ptr, ptr+size);
+			shmem_swp_unmap(ptr);
 			if (offset >= 0) {
 				shmem_dir_unmap(dir);
+				ptr = shmem_swp_map(subdir);
 				goto found;
 			}
-			shmem_swp_unmap(ptr);
 		}
 	}
 lost1:

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

only message in thread, other threads:[~2011-05-20 22:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-20 22:47 [PATCH] tmpfs: fix highmem swapoff crash regression 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).