AFS: Fix afs_prepare_write()
authorDavid Howells <dhowells@redhat.com>
Wed, 16 May 2007 06:57:04 +0000 (23:57 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 17 May 2007 04:19:15 +0000 (21:19 -0700)
afs_prepare_write() should not mark a page up to date if it only partially
fills it in, in expectation of the caller filling in the rest prior to calling
commit_write().  commit_write(), however, should mark the page up to date.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/afs/write.c

index 28f37516c12600e682a1c78365bc67af6e6372f5..a03b92a0fe1db9240d7b3ff4d1ffc0a92a222193 100644 (file)
@@ -206,7 +206,6 @@ int afs_prepare_write(struct file *file, struct page *page,
                        _leave(" = %d [prep]", ret);
                        return ret;
                }
-               SetPageUptodate(page);
        }
 
 try_again:
@@ -311,8 +310,8 @@ int afs_commit_write(struct file *file, struct page *page,
                spin_unlock(&vnode->writeback_lock);
        }
 
+       SetPageUptodate(page);
        set_page_dirty(page);
-
        if (PageDirty(page))
                _debug("dirtied");