Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-30 Thread Trond Myklebust
On Wed, 2007-05-30 at 11:35 +0100, David Howells wrote: > Trond Myklebust <[EMAIL PROTECTED]> wrote: > > > All I do is to protect new calls to read() and write() with a call to > > check if the page cache needs invalidating. > > What about mmap()? What if someone gets a mapping on a section of

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-30 Thread David Howells
Trond Myklebust <[EMAIL PROTECTED]> wrote: > All I do is to protect new calls to read() and write() with a call to > check if the page cache needs invalidating. What about mmap()? What if someone gets a mapping on a section of file that subsequently has a write rejected on it? If you

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-30 Thread David Howells
Trond Myklebust [EMAIL PROTECTED] wrote: All I do is to protect new calls to read() and write() with a call to check if the page cache needs invalidating. What about mmap()? What if someone gets a mapping on a section of file that subsequently has a write rejected on it? If you invalidate

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-30 Thread Trond Myklebust
On Wed, 2007-05-30 at 11:35 +0100, David Howells wrote: Trond Myklebust [EMAIL PROTECTED] wrote: All I do is to protect new calls to read() and write() with a call to check if the page cache needs invalidating. What about mmap()? What if someone gets a mapping on a section of file that

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread Trond Myklebust
On Fri, 2007-05-25 at 00:18 +0100, David Howells wrote: > Trond Myklebust <[EMAIL PROTECTED]> wrote: > > > No. If the write fails, then NFS will mark the mapping as invalid and > > attempt to call invalidate_inode_pages2() at the earliest possible > > moment. > > Will it erase *all* unwritten

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread David Howells
Andrew Morton <[EMAIL PROTECTED]> wrote: > But we already covered that? Your exciser can do an unconditional > end_page_writeback(), because it is this thread of control which did the > set_page_writeback(). So we end up with: Ah, I misunderstood what you meant. I assumed you meant to wait

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread Andrew Morton
On Fri, 25 May 2007 00:08:43 +0100 David Howells <[EMAIL PROTECTED]> wrote: > Andrew Morton <[EMAIL PROTECTED]> wrote: > > > hm. I don't see why that race window would be a problem in practice: the > > page-exciser does a lock_page();wait_on_page_writeback() as normal, then > > proceeds with

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread David Howells
Trond Myklebust <[EMAIL PROTECTED]> wrote: > No. If the write fails, then NFS will mark the mapping as invalid and > attempt to call invalidate_inode_pages2() at the earliest possible > moment. Will it erase *all* unwritten writes? Or is that what launder_page() is for? How do you deal with

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread David Howells
Andrew Morton <[EMAIL PROTECTED]> wrote: > hm. I don't see why that race window would be a problem in practice: the > page-exciser does a lock_page();wait_on_page_writeback() as normal, then > proceeds with its business? No. The page-exciser ends (cancels) PG_writeback, not waits for it

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread Andrew Morton
On Thu, 24 May 2007 23:34:33 +0100 David Howells <[EMAIL PROTECTED]> wrote: > Andrew Morton <[EMAIL PROTECTED]> wrote: > > > So my reason for asking the above is to try to find a way to make all these > > new PG-error games just go away. > > Yeah. However, there needs to be something to cover

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread Trond Myklebust
On Thu, 2007-05-24 at 22:35 +0100, David Howells wrote: > Andrew Morton <[EMAIL PROTECTED]> wrote: > > > Could you please flesh this out a bit, from a higher level? > > See the description for patch 3/4. > > > As in: what does it mean for a server to "reject" a write? What's actually > > going

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread David Howells
Andrew Morton <[EMAIL PROTECTED]> wrote: > So my reason for asking the above is to try to find a way to make all these > new PG-error games just go away. Yeah. However, there needs to be something to cover the gap between releasing PG_writeback and getting PG_lock. They have to be done in that

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread Andrew Morton
On Thu, 24 May 2007 22:35:22 +0100 David Howells <[EMAIL PROTECTED]> wrote: > > > Why can't we just run the end_page_writeback() unconditionally? > > PG_writeback _must_ be set here, and it is the caller who set PG_writeback, > > so this thread of control "owns" that flag. > > You may be

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread David Howells
Andrew Morton <[EMAIL PROTECTED]> wrote: > Could you please flesh this out a bit, from a higher level? See the description for patch 3/4. > As in: what does it mean for a server to "reject" a write? What's actually > going on here? Simply, it means that the server refused to perform the write.

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread Andrew Morton
On Wed, 23 May 2007 20:15:24 +0100 David Howells <[EMAIL PROTECTED]> wrote: > Add a function - cancel_rejected_write() - to excise a rejected write from the > pagecache. This function is related to the truncation family of routines. It > permits the pages modified by a network filesystem client

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread Andrew Morton
On Wed, 23 May 2007 20:15:24 +0100 David Howells [EMAIL PROTECTED] wrote: Add a function - cancel_rejected_write() - to excise a rejected write from the pagecache. This function is related to the truncation family of routines. It permits the pages modified by a network filesystem client

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread David Howells
Andrew Morton [EMAIL PROTECTED] wrote: Could you please flesh this out a bit, from a higher level? See the description for patch 3/4. As in: what does it mean for a server to reject a write? What's actually going on here? Simply, it means that the server refused to perform the write. The

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread Andrew Morton
On Thu, 24 May 2007 22:35:22 +0100 David Howells [EMAIL PROTECTED] wrote: Why can't we just run the end_page_writeback() unconditionally? PG_writeback _must_ be set here, and it is the caller who set PG_writeback, so this thread of control owns that flag. You may be right. I'm trying

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread David Howells
Andrew Morton [EMAIL PROTECTED] wrote: So my reason for asking the above is to try to find a way to make all these new PG-error games just go away. Yeah. However, there needs to be something to cover the gap between releasing PG_writeback and getting PG_lock. They have to be done in that

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread Trond Myklebust
On Thu, 2007-05-24 at 22:35 +0100, David Howells wrote: Andrew Morton [EMAIL PROTECTED] wrote: Could you please flesh this out a bit, from a higher level? See the description for patch 3/4. As in: what does it mean for a server to reject a write? What's actually going on here?

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread Andrew Morton
On Thu, 24 May 2007 23:34:33 +0100 David Howells [EMAIL PROTECTED] wrote: Andrew Morton [EMAIL PROTECTED] wrote: So my reason for asking the above is to try to find a way to make all these new PG-error games just go away. Yeah. However, there needs to be something to cover the gap

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread David Howells
Andrew Morton [EMAIL PROTECTED] wrote: hm. I don't see why that race window would be a problem in practice: the page-exciser does a lock_page();wait_on_page_writeback() as normal, then proceeds with its business? No. The page-exciser ends (cancels) PG_writeback, not waits for it (something

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread David Howells
Trond Myklebust [EMAIL PROTECTED] wrote: No. If the write fails, then NFS will mark the mapping as invalid and attempt to call invalidate_inode_pages2() at the earliest possible moment. Will it erase *all* unwritten writes? Or is that what launder_page() is for? How do you deal with pages

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread Andrew Morton
On Fri, 25 May 2007 00:08:43 +0100 David Howells [EMAIL PROTECTED] wrote: Andrew Morton [EMAIL PROTECTED] wrote: hm. I don't see why that race window would be a problem in practice: the page-exciser does a lock_page();wait_on_page_writeback() as normal, then proceeds with its business?

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread David Howells
Andrew Morton [EMAIL PROTECTED] wrote: But we already covered that? Your exciser can do an unconditional end_page_writeback(), because it is this thread of control which did the set_page_writeback(). So we end up with: Ah, I misunderstood what you meant. I assumed you meant to wait insted

Re: [PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-24 Thread Trond Myklebust
On Fri, 2007-05-25 at 00:18 +0100, David Howells wrote: Trond Myklebust [EMAIL PROTECTED] wrote: No. If the write fails, then NFS will mark the mapping as invalid and attempt to call invalidate_inode_pages2() at the earliest possible moment. Will it erase *all* unwritten writes? Or is

[PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-23 Thread David Howells
Add a function - cancel_rejected_write() - to excise a rejected write from the pagecache. This function is related to the truncation family of routines. It permits the pages modified by a network filesystem client (such as AFS) to be excised and discarded from the pagecache if the attempt to

[PATCH 2/4] AFS: Add a function to excise a rejected write from the pagecache

2007-05-23 Thread David Howells
Add a function - cancel_rejected_write() - to excise a rejected write from the pagecache. This function is related to the truncation family of routines. It permits the pages modified by a network filesystem client (such as AFS) to be excised and discarded from the pagecache if the attempt to