Skip to contentSkip to conversation

bugfix in memory.c

PATCH New [email protected] 1 participant 1 message Jul 29, 2001

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bugfix in memory.c

The following is a bugfix against memory.c:lock_kiovec, At line 649 we have:

	if (!PageLocked(page)) {

which assumes page is the page we failed to lock, and if it is unlocked after calling the unlock_kiovec we have a page which has been mapped twice, but page has been modified and it doesn't contain the expected value.

Patch is against 2.4.8-pre1, Comments are welcome.

--

memory.c renamed from memory.c.old +4 -3
@@ -619,9 +619,10 @@
 			
 			if (TryLockPage(page)) {
 				while (j--) {
-					page = *(--ppage);
-					if (page)
-						UnlockPage(page);
+					struct page *tmp;
+					tmp = *(--ppage);
+					if (tmp)
+						UnlockPage(tmp);
 				}
 				goto retry;
 			}