Re: page_mkwrite caller is racy?

2007-02-01 Thread David Howells
Hugh Dickins <[EMAIL PROTECTED]> wrote: > > Must it be able to sleep? > > Not as David was using it It absolutely *must* be able to sleep. It has to wait for FS-Cache to finish writing the page to the cache before letting the PTE be made writable. David - To unsubscribe from this list: send th

Re: page_mkwrite caller is racy?

2007-01-30 Thread Nick Piggin
Anton Altaparmakov wrote: On Mon, 29 Jan 2007, Mark Fasheh wrote: No page lock please. Generally, Ocfs2 wants to order cluster locks outside of page locks. Also, the sparse b-tree support I'm working on right now will need to be able to allocate in ->page_mkwrite() which would become very nast

Re: page_mkwrite caller is racy?

2007-01-30 Thread Anton Altaparmakov
On Mon, 29 Jan 2007, Mark Fasheh wrote: > On Tue, Jan 30, 2007 at 12:14:24PM +1100, Nick Piggin wrote: > > This is another discussion, but do we want the page locked here? Or > > are the filesystems happy to exclude truncate themselves? > > No page lock please. Generally, Ocfs2 wants to order clus

Re: page_mkwrite caller is racy?

2007-01-29 Thread Mark Fasheh
On Tue, Jan 30, 2007 at 12:14:24PM +1100, Nick Piggin wrote: > This is another discussion, but do we want the page locked here? Or > are the filesystems happy to exclude truncate themselves? No page lock please. Generally, Ocfs2 wants to order cluster locks outside of page locks. Also, the sparse

Re: page_mkwrite caller is racy?

2007-01-29 Thread Nick Piggin
Hugh Dickins wrote: On Mon, 29 Jan 2007, Nick Piggin wrote: Moving page_cache_release(old_page) to below the next statement will fix that problem. Yes. I'm reluctant to steal your credit, but also reluctant to go back and forth too much over this: please insert your Signed-off-by _before_

Re: page_mkwrite caller is racy?

2007-01-29 Thread Anton Altaparmakov
On Mon, 29 Jan 2007, Hugh Dickins wrote: > On Mon, 29 Jan 2007, Nick Piggin wrote: > > After do_wp_page calls page_mkwrite on its target (old_page), it then drops > > the reference to the page before locking the ptl and verifying that the pte > > points to old_page. > > > > Unfortunately, old_page

Re: page_mkwrite caller is racy?

2007-01-29 Thread Mark Fasheh
On Mon, Jan 29, 2007 at 09:20:58PM +1100, Nick Piggin wrote: > But it is sad that this thing got merged without any callers to even know > how it is intended to work. Must it be able to sleep? Ocfs2 absolutely needs to be able to sleep in there in order to take cluster locks, do allocation, etc. I

Re: page_mkwrite caller is racy?

2007-01-29 Thread Hugh Dickins
On Mon, 29 Jan 2007, Nick Piggin wrote: > > After do_wp_page calls page_mkwrite on its target (old_page), it then drops > the reference to the page before locking the ptl and verifying that the pte > points to old_page. > > Unfortunately, old_page may have been truncated and freed, or reclaimed,

page_mkwrite caller is racy?

2007-01-29 Thread Nick Piggin
Hi, After do_wp_page calls page_mkwrite on its target (old_page), it then drops the reference to the page before locking the ptl and verifying that the pte points to old_page. Unfortunately, old_page may have been truncated and freed, or reclaimed, then re-allocated and used again for the same p