Messages in this thread Patch in this message | | | Date | Thu, 19 Aug 1999 21:32:23 +0200 (CEST) | From | Andrea Arcangeli <> | Subject | Re: [PATCH] 2.3.14: bug-fix for raw IO error recovery |
| |
On Thu, 19 Aug 1999, Stephen C. Tweedie wrote:
>As far as map_user_kiobuf() is concerned that is definitely a feature: I >want it to be able to encode user virtual addresses which might contain >non-page-struct pages (eg. video framebuffers). That's why there are
Ah, I see your point now. thanks.
Wouldn't be possible to let get_page_map to give us back more information by returning -1 if the page_map is not good?
What do you think about this patch:
--- 2.3.14-pre2-rawio/mm/memory.c.~1~ Thu Aug 12 02:53:25 1999 +++ 2.3.14-pre2-rawio/mm/memory.c Thu Aug 19 21:29:55 1999 @@ -418,10 +418,10 @@ if (MAP_NR(page) >= max_mapnr) return 0; if (page == ZERO_PAGE(page)) - return 0; + return (struct page *) -1; map = mem_map + MAP_NR(page); if (PageReserved(map)) - return 0; + return (struct page *) -1; return map; } @@ -485,6 +485,12 @@ goto retry; } map = get_page_map(page); + if (map == (struct page *) -1) + { + dprintk(KERN_WARNING + "Forbidden page_map in map_user_kiobuf\n"); + goto out_unlock_page_table; + } if (map) { if (TryLockPage(map)) { goto retry; @@ -504,6 +510,8 @@ dprintk ("map_user_kiobuf: end OK\n"); return 0; + out_unlock_page_table: + spin_unlock(&mm->page_table_lock); out_unlock: up(&mm->mmap_sem); unmap_kiobuf(iobuf); Andrea
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |