Skip to contentSkip to conversation

<no subject>

PATCH Joachim Bremer 2 participants 2 messages Aug 29, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

As mentioned before I got even with Nicks patch some errors. Looking closer at the source there is is a second "goto page_ok" a few lines down the label "page_not_up_to_date". Inserting the same calculating code used before the label "readpage_error" fixes the errors on my machine. These for instance where failure to do reiserfsck (bread complains on last block of device) and compiling the linux-tree (file truncated).

The leads to the same calculation 3 times...

Patch attached

Joachim
_______________________________________________________
WEB.DE Video-Mail - Sagen Sie mehr mit bewegten Bildern Informationen unter: http://freemail.web.de/?mc=021199

mm/filemap.c +9 -0
@@ -798,6 +798,15 @@ page_not_up_to_date:
 		/* Did somebody else fill it already? */
 		if (PageUptodate(page)) {
 			unlock_page(page);
+			nr = PAGE_CACHE_SIZE;
+			if (index == end_index) {
+				nr = isize & ~PAGE_CACHE_MASK;
+				if (nr <= offset) {
+					page_cache_release(page);
+					goto out;
+				}
+			}
+			nr = nr - offset;
 			goto page_ok;
 		}
 
#1 lore raw
Quoted 9 lines · Joachim Bremer

As mentioned before I got even with Nicks patch some errors. Looking closer at the source there is is a second "goto page_ok" a few lines down the label "page_not_up_to_date". Inserting the same calculating code used before the label "readpage_error" fixes the errors on my machine. These for instance where failure to do reiserfsck (bread complains on last block of device) and compiling the linux-tree (file truncated).

The leads to the same calculation 3 times...

Surely not - there is only 1 way to get to page_not_up_to_date, and through that path you have already done that calculation and none of the variables involved have been changed.

I think. Put a printk before your goto out, and if it triggers then I am wrong.

What errors were you seeing with my patch? (If you applied my patch to an -mm kernel without first backing out the others then it will break).