Re: [PATCH 3/3] AFS: Implement basic file write support

2007-05-10 Thread Nick Piggin
David Howells wrote: Nick Piggin <[EMAIL PROTECTED]> wrote: Why do you call SetPageUptodate when the page is not up to date? That leaks uninitialised data, AFAIKS. It only seems that way. If afs_prepare_write() is called, but doesn't return an error, then afs_commit_write() will be called,

Re: [PATCH 3/3] AFS: Implement basic file write support

2007-05-10 Thread David Howells
Nick Piggin <[EMAIL PROTECTED]> wrote: > Why do you call SetPageUptodate when the page is not up to date? > That leaks uninitialised data, AFAIKS. It only seems that way. If afs_prepare_write() is called, but doesn't return an error, then afs_commit_write() will be called, and it seems that the

Re: [PATCH 3/3] AFS: Implement basic file write support

2007-05-09 Thread Nick Piggin
David Howells wrote: +/* + * prepare a page for being written to + */ +static int afs_prepare_page(struct afs_vnode *vnode, struct page *page, + struct key *key, unsigned offset, unsigned to) +{ + unsigned eof, tail, start, stop, len; + loff_t i_size, pos; +

Re: [PATCH 3/3] AFS: Implement basic file write support

2007-05-09 Thread Andrew Morton
On Wed, 09 May 2007 12:07:39 +0100 David Howells <[EMAIL PROTECTED]> wrote: > Andrew Morton <[EMAIL PROTECTED]> wrote: > > > set_page_dirty() will set I_DIRTY_PAGES only. ie: the inode has dirty > > pagecache data. > > > > To tell the VFS that the inode itself is dirty one needs to run > > mark

Re: [PATCH 3/3] AFS: Implement basic file write support

2007-05-09 Thread David Howells
Andrew Morton <[EMAIL PROTECTED]> wrote: > set_page_dirty() will set I_DIRTY_PAGES only. ie: the inode has dirty > pagecache data. > > To tell the VFS that the inode itself is dirty one needs to run > mark_inode_dirty(). But what's the difference in this case? I don't need to write the inode b

Re: [PATCH 3/3] AFS: Implement basic file write support

2007-05-09 Thread Andrew Morton
On Wed, 09 May 2007 11:25:47 +0100 David Howells <[EMAIL PROTECTED]> wrote: > > > + set_page_dirty(page); > > > + > > > + if (PageDirty(page)) > > > + _debug("dirtied"); > > > + > > > + return 0; > > > +} > > > > One would normally run mark_inode_dirty() after any i_size_write()? > > Not

Re: [PATCH 3/3] AFS: Implement basic file write support

2007-05-09 Thread David Howells
Andrew Morton <[EMAIL PROTECTED]> wrote: > > + BUG_ON(i_size > 0x); // TODO: use 64-bit store > > You're sure this isn't user-triggerable? Hmmm... I'm not. I'll whip up a patch for this. > kmap_atomic() could be used here and is better. Yeah. It used to have something that slept i

Re: [PATCH 3/3] AFS: Implement basic file write support

2007-05-08 Thread Andrew Morton
On Tue, 08 May 2007 20:44:11 +0100 David Howells <[EMAIL PROTECTED]> wrote: > Implement support for writing to regular AFS files, including: > > (1) write > > (2) truncate > > (3) fsync, fdatasync > > (4) chmod, chown, chgrp, utime. > > AFS writeback attempts to batch writes into as chunk

[PATCH 3/3] AFS: Implement basic file write support

2007-05-08 Thread David Howells
Implement support for writing to regular AFS files, including: (1) write (2) truncate (3) fsync, fdatasync (4) chmod, chown, chgrp, utime. AFS writeback attempts to batch writes into as chunks as large as it can manage up to the point that it writes back 65535 pages in one chunk or it meet