public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: linux-kernel@vger.kernel.org, fuse-devel@lists.sourceforge.net,
	miklos@szeredi.hu, akpm@linux-foundation.org, npiggin@suse.de
Cc: Tejun Heo <tj@kernel.org>
Subject: [PATCH 1/5] mmap: don't assume f_op->mmap() doesn't change vma->vm_file
Date: Tue, 14 Apr 2009 11:04:18 +0900	[thread overview]
Message-ID: <1239674662-31318-2-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1239674662-31318-1-git-send-email-tj@kernel.org>

mmap_region() assumes that vma->vm_file isn't changed by f_op->mmap()
and continues to use cache file after f_op->mmap() returns.  Don't
assume that.  This will be used by FUSE to redirect mmap to
shmem_file.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Nick Piggin <npiggin@suse.de>
---
 mm/mmap.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index 4a38411..46a7ae5 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1194,6 +1194,7 @@ munmap_back:
 		vma->vm_file = file;
 		get_file(file);
 		error = file->f_op->mmap(file, vma);
+		file = vma->vm_file;
 		if (error)
 			goto unmap_and_free_vma;
 		if (vm_flags & VM_EXECUTABLE)
-- 
1.6.0.2


  reply	other threads:[~2009-04-14  2:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14  2:04 [PATCHSET] FUSE: implement direct mmap, take#2 Tejun Heo
2009-04-14  2:04 ` Tejun Heo [this message]
2009-04-14 19:59   ` [PATCH 1/5] mmap: don't assume f_op->mmap() doesn't change vma->vm_file Hugh Dickins
2009-04-15  2:22     ` Tejun Heo
2009-04-15  4:13   ` Tejun Heo
2009-04-14  2:04 ` [PATCH 2/5] fdtable: export alloc_fd() Tejun Heo
2009-04-14  2:04 ` [PATCH 3/5] FUSE: make request_wait_answer() wait for ->end() completion Tejun Heo
2009-04-14  2:04 ` [PATCH 4/5] FUSE: implement fuse_req->prep() Tejun Heo
2009-04-14  2:04 ` [PATCH 5/5] FUSE: implement direct mmap Tejun Heo
2009-04-15  4:14   ` [PATCH UPDATED] " Tejun Heo

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=1239674662-31318-2-git-send-email-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=npiggin@suse.de \
    /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