public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Halcrow <mhalcrow@us.ibm.com>
To: akpm@osdl.org
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] eCryptfs: Grab lock on lower_page in ecryptfs_sync_page
Date: Wed, 27 Sep 2006 11:29:56 -0500	[thread overview]
Message-ID: <20060927162956.GC3256@us.ibm.com> (raw)

The recent swap of grab_cache_page() with find_get_page() in
ecryptfs_sync_page() missed the fact that we need a lock on the lower
page. This patch replaces find_get_page() with find_lock_page() in
order to make sure that this lock is obtained.

Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>

---

 fs/ecryptfs/mmap.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

ef0b82f22907486bd87f8c37508a9f7d1dcd5601
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
index 8a4040d..924dd90 100644
--- a/fs/ecryptfs/mmap.c
+++ b/fs/ecryptfs/mmap.c
@@ -766,9 +766,9 @@ static void ecryptfs_sync_page(struct pa
 	lower_inode = ecryptfs_inode_to_lower(inode);
 	/* NOTE: Recently swapped with grab_cache_page(), since
 	 * sync_page() just makes sure that pending I/O gets done. */
-	lower_page = find_get_page(lower_inode->i_mapping, page->index);
+	lower_page = find_lock_page(lower_inode->i_mapping, page->index);
 	if (!lower_page) {
-		ecryptfs_printk(KERN_DEBUG, "find_get_page failed\n");
+		ecryptfs_printk(KERN_DEBUG, "find_lock_page failed\n");
 		return;
 	}
 	lower_page->mapping->a_ops->sync_page(lower_page);
-- 
1.3.3


                 reply	other threads:[~2006-09-27 16:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20060927162956.GC3256@us.ibm.com \
    --to=mhalcrow@us.ibm.com \
    --cc=akpm@osdl.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