Commit e6c9366b authored by Hugh Dickins's avatar Hugh Dickins Committed by Linus Torvalds

tmpfs: fix highmem swapoff crash regression

Commit 778dd893 ("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=35352Reported-by: default avatarWitold Baryluk <baryluk@smp.if.uj.edu.pl>
Signed-off-by: default avatarHugh Dickins <hughd@google.com>
Cc: stable@kernel.org
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6de06f31
...@@ -916,11 +916,12 @@ static int shmem_unuse_inode(struct shmem_inode_info *info, swp_entry_t entry, s ...@@ -916,11 +916,12 @@ static int shmem_unuse_inode(struct shmem_inode_info *info, swp_entry_t entry, s
if (size > ENTRIES_PER_PAGE) if (size > ENTRIES_PER_PAGE)
size = ENTRIES_PER_PAGE; size = ENTRIES_PER_PAGE;
offset = shmem_find_swp(entry, ptr, ptr+size); offset = shmem_find_swp(entry, ptr, ptr+size);
shmem_swp_unmap(ptr);
if (offset >= 0) { if (offset >= 0) {
shmem_dir_unmap(dir); shmem_dir_unmap(dir);
ptr = shmem_swp_map(subdir);
goto found; goto found;
} }
shmem_swp_unmap(ptr);
} }
} }
lost1: lost1:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment