linux/fs/nfs
Trond Myklebust 1b3b4a1a2d NFS: Fix a write request leak in nfs_invalidate_page()
Ryusuke Konishi says:

The recent truncate_complete_page() clears the dirty flag from a page
before calling a_ops->invalidatepage(),
^^^^^^
static void
truncate_complete_page(struct address_space *mapping, struct page *page)
{
        ...
        cancel_dirty_page(page, PAGE_CACHE_SIZE);  <--- Inserted here at
kernel 2.6.20

        if (PagePrivate(page))
                do_invalidatepage(page, 0);   ---> will call
a_ops->invalidatepage()
        ...
}

and this is disturbing nfs_wb_page_priority() from calling 
nfs_writepage_locked() that is expected to handle the pending
request (=nfs_page) associated with the page.

int nfs_wb_page_priority(struct inode *inode, struct page *page, int how)
{
        ...
        if (clear_page_dirty_for_io(page)) {
                ret = nfs_writepage_locked(page, &wbc);
                if (ret < 0)
                        goto out;
        }
        ...
}

Since truncate_complete_page() will get rid of the page after
a_ops->invalidatepage() returns, the request (=nfs_page) associated
with the page becomes a garbage in nfs_inode->nfs_page_tree.
------------------------

Fix this by ensuring that nfs_wb_page_priority() recognises that it may
also need to clear out non-dirty pages that have an nfs_page associated
with them.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-09-01 10:14:54 -04:00
..
callback_proc.c
callback_xdr.c
callback.c
callback.h
client.c
delegation.c NFSv4: Don't call put_rpccred() from an rcu callback 2007-08-07 15:15:57 -04:00
delegation.h
dir.c
direct.c
file.c NFS: Fix a write request leak in nfs_invalidate_page() 2007-09-01 10:14:54 -04:00
getroot.c
idmap.c
inode.c NFS: Fix put_nfs_open_context 2007-08-07 15:13:17 -04:00
internal.h
iostat.h
Makefile
mount_clnt.c
namespace.c NFS: Fix use of cancel_delayed_work_sync in nfs_release_automount_timer 2007-09-01 10:14:36 -04:00
nfs2xdr.c
nfs3acl.c
nfs3proc.c
nfs3xdr.c
nfs4_fs.h
nfs4namespace.c
nfs4proc.c NFSv4: Ensure that we pass the correct dentry to nfs4_intent_set_file 2007-09-01 10:14:38 -04:00
nfs4renewd.c NFS: Replace flush_scheduled_work with cancel_work_sync() and friends 2007-08-07 16:12:50 -04:00
nfs4state.c NFSv4: Fix a locking regression in nfs4_set_mode_locked() 2007-08-07 15:13:18 -04:00
nfs4xdr.c
nfsroot.c
pagelist.c
proc.c
read.c
super.c NFS: change NFS mount error return when hostname/pathname too long 2007-09-01 10:14:40 -04:00
symlink.c
sysctl.c
unlink.c
write.c NFS: Fix a write request leak in nfs_invalidate_page() 2007-09-01 10:14:54 -04:00