[PATCH] tmpfs preempt count panic

From: Hugh Dickins
Date: Thu Jul 15 2004 - 12:02:12 EST


Just unearthed another of my warcrimes: reading a 17-page sparse file,
I mean holey file, hits the in_interrupt panic in do_exit on a current
highmem kernel (but 2.6.7 is okay). Fix mismatched preempt count from
shmem_swp_alloc's swapindex hole case by mapping an empty_zero_page.

Signed-off-by: Hugh Dickins <hugh@xxxxxxxxxxx>

--- 2.6.8-rc1/mm/shmem.c 2004-07-11 21:59:42.000000000 +0100
+++ linux/mm/shmem.c 2004-07-15 17:27:58.545771152 +0100
@@ -337,7 +337,6 @@ static swp_entry_t *shmem_swp_alloc(stru
struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb);
struct page *page = NULL;
swp_entry_t *entry;
- static const swp_entry_t unswapped = { 0 };

if (sgp != SGP_WRITE &&
((loff_t) index << PAGE_CACHE_SHIFT) >= i_size_read(inode))
@@ -345,7 +344,7 @@ static swp_entry_t *shmem_swp_alloc(stru

while (!(entry = shmem_swp_entry(info, index, &page))) {
if (sgp == SGP_READ)
- return (swp_entry_t *) &unswapped;
+ return shmem_swp_map(ZERO_PAGE(0));
/*
* Test free_blocks against 1 not 0, since we have 1 data
* page (and perhaps indirect index pages) yet to allocate:

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/