mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel McNeil <daniel@osdl.org>
To: Andrew Morton <akpm@osdl.org>
Cc: "linux-aio@kvack.org" <linux-aio@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH 2.6.3-rc2-mm1] filemap_fdatawait patch
Date: 13 Feb 2004 13:49:48 -0800	[thread overview]
Message-ID: <1076708987.1956.63.camel@ibm-c.pdx.osdl.net> (raw)
In-Reply-To: <1076707830.1956.46.camel@ibm-c.pdx.osdl.net>

[-- Attachment #1: Type: text/plain, Size: 635 bytes --]

Andrew,

This is re-diffed against 2.6.3-rc2-mm1.

This adds the lock_page() and check for PageDirty() in
filemap_fdatawait().

I did additional direct_read_under testing with a forked() process
doing "sync()" and without this patch I hit uninitialized data
even with the __block_write_full_page() patch.

Thoughts?

Daniel

PS

I still think there is potential problem if we ever allow multiple
filemap_fdatawait() to occur in parallel since filemap_fdatawait()
waits for a page with the page unlinked from the locked list.
The 2nd filemap_fdatawait() would never see that page to wait.
I might take care of that in a future patch.



[-- Attachment #2: filemap_fdatawait.2.6.3-rc2-mm1.patch --]
[-- Type: text/plain, Size: 609 bytes --]

--- linux-2.6.3-rc2-mm1.orig/mm/filemap.c	2004-02-12 15:04:41.000000000 -0800
+++ linux-2.6.3-rc2-mm1/mm/filemap.c	2004-02-13 12:57:08.777799758 -0800
@@ -209,10 +209,15 @@ restart:
 		page_cache_get(page);
 		spin_unlock(&mapping->page_lock);
 
-		wait_on_page_writeback(page);
-		if (PageError(page))
-			ret = -EIO;
-
+		lock_page(page);
+		if (PageDirty(page) && mapping->a_ops->writepage) {
+			write_one_page(page, 1);
+		} else {
+			wait_on_page_writeback(page);
+			unlock_page(page);
+		}
+ 		if (PageError(page))
+ 			ret = -EIO;
 		page_cache_release(page);
 		spin_lock(&mapping->page_lock);
 	}

  reply	other threads:[~2004-02-13 21:50 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-12  9:57 2.6.3-rc2-mm1 Andrew Morton
2004-02-12 11:13 ` 2.6.3-rc2-mm1 Andrew Morton
2004-02-12 11:57   ` 2.6.3-rc2-mm1 Anton Blanchard
2004-02-12 12:09     ` 2.6.3-rc2-mm1 Andrew Morton
2004-02-12 14:40       ` 2.6.3-rc2-mm1 Zwane Mwaikambo
2004-02-12 14:46         ` 2.6.3-rc2-mm1 Anton Blanchard
2004-02-12 14:47       ` 2.6.3-rc2-mm1 Anton Blanchard
2004-02-12 11:24 ` 2.6.3-rc2-mm1 Nick Piggin
2004-02-12 14:46   ` 2.6.3-rc2-mm1 Zwane Mwaikambo
2004-02-12 15:40   ` 2.6.3-rc2-mm1 Mark Haverkamp
2004-02-12 21:38     ` 2.6.3-rc2-mm1 Andrew Morton
2004-02-12 22:33     ` 2.6.3-rc2-mm1 Nick Piggin
2004-02-12 17:06 ` 2.6.3-rc2-mm1 (compile stats) John Cherry
2004-02-12 18:43 ` 2.6.3-rc2-mm1 Alistair John Strachan
2004-02-12 20:33 ` 2.6.3-rc2-mm1 (dm) Miquel van Smoorenburg
2004-02-12 21:28   ` Nathan Scott
2004-02-12 22:08     ` Miquel van Smoorenburg
2004-02-12 22:34     ` Andrew Morton
2004-02-13 16:29       ` Miquel van Smoorenburg
2004-02-13  0:04 ` 2.6.3-rc2-mm1 Torrey Hoffman
2004-02-14 10:36   ` 2.6.3-rc2-mm1 Terje Kvernes
2004-02-13 21:04 ` [PATCH 2.6.3-rc2-mm1] Daniel McNeil
2004-02-13 21:30 ` [PATCH 2.6.3-rc2-mm1] __block_write_full patch Daniel McNeil
2004-02-13 21:49   ` Daniel McNeil [this message]
2004-02-13 22:38   ` Andrew Morton
2004-02-13 23:30     ` Daniel McNeil
2004-02-13 23:48       ` Andrew Morton
2004-02-14  0:02         ` Daniel McNeil
2004-02-18  1:02         ` [PATCH 2.6.3-rc2-mm1] address_space_serialize_writeback patch Daniel McNeil
2004-02-18  1:43           ` Andrew Morton
2004-02-18  1:47           ` Andrew Morton
2004-02-18 19:36             ` Daniel McNeil
2004-02-14  5:27 ` 2.6.3-rc2-mm1 Glenn Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1076708987.1956.63.camel@ibm-c.pdx.osdl.net \
    --to=daniel@osdl.org \
    --cc=akpm@osdl.org \
    --cc=linux-aio@kvack.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®