From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>,
Andi Kleen <andi@firstfloor.org>,
linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org
Subject: Re: [RFC PATCH 0/2] Fix up the NFS mmap code
Date: Sat, 9 Jan 2010 01:46:34 +0000 [thread overview]
Message-ID: <20100109014634.GE30528@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20100109013825.GD30528@ZenIV.linux.org.uk>
On Sat, Jan 09, 2010 at 01:38:25AM +0000, Al Viro wrote:
> On Fri, Jan 08, 2010 at 05:17:14PM -0800, Linus Torvalds wrote:
> >
> >
> > On Fri, 8 Jan 2010, Trond Myklebust wrote:
> > >
> > > How about something like the following. I chose to wrap the call to
> > > do_mmap_pgoff() instead of making a special ->pre_mmap(), since that
> > > seems more consistent with the way we handle ->read() and ->write().
> >
> > I still don't think that you can ever do mmap _and_ readdir on the same
> > inode, so there's something wrong with the lockdep annotations.
>
> readdir() is certainly a red herring. write(), OTOH, is quite real.
> And there we do i_mutex followed by pagefaults.
>
> I *REALLY* dislike Trond's solution, though.
>
> Could we please get a sane expalanation of the reasons why nfs mmap
> wants i_mutex in the first place? Before we add yet another hook
> from hell and complicate already overcomplicated area...
PS: mmap/write deadlock is real, AFAICT - unless something very subtle
prevents it, we can get buggered if we have two threads with the same
VM, mmap 1.4Mb from floppy and do
thread A:
write(fd_on_nfs, buffer_mmaped_from_floppy, 1440 * 1024);
thread B:
mmap(..., fd_on_nfs, ...)
It's not even particulary narrow.
next prev parent reply other threads:[~2010-01-09 1:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1262913974.2659.101.camel@localhost>
2010-01-09 0:56 ` [RFC PATCH 0/2] Fix up the NFS mmap code Trond Myklebust
[not found] ` <20100109005624.7473.33215.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-01-09 0:56 ` [RFC PATCH 1/2] VFS: Add a mmap_file() callback to struct file_operations Trond Myklebust
2010-01-09 1:17 ` [RFC PATCH 0/2] Fix up the NFS mmap code Linus Torvalds
[not found] ` <alpine.LFD.2.00.1001081709470.7821-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-01-09 1:38 ` Al Viro
2010-01-09 1:46 ` Al Viro [this message]
2010-01-09 1:57 ` Linus Torvalds
[not found] ` <alpine.LFD.2.00.1001081750080.7821-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-01-09 2:11 ` Al Viro
2010-01-09 2:22 ` Linus Torvalds
[not found] ` <alpine.LFD.2.00.1001081814240.7821-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-01-09 2:30 ` Al Viro
2010-01-09 2:40 ` Al Viro
2010-01-09 2:43 ` Al Viro
2010-01-10 2:00 ` Andi Kleen
2010-01-09 0:56 ` [RFC PATCH 2/2] NFS: Fix a potential deadlock in nfs_file_mmap() Trond Myklebust
[not found] ` <20100109005624.7473.15560.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-01-09 1:54 ` Al Viro
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=20100109014634.GE30528@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=Trond.Myklebust@netapp.com \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=torvalds@linux-foundation.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