diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-12-07 22:39:17 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-12-07 23:02:44 -0500 |
commit | 2df485a774ba59c3f43bfe84107672c1d9b731a0 (patch) | |
tree | a958e82f619290cb5cb28301e30186ef594cd7b4 /fs/nfs/read.c | |
parent | 0de1b7e800188782973598158e0acbb9e08e6c99 (diff) | |
download | linux-2df485a774ba59c3f43bfe84107672c1d9b731a0.tar.gz linux-2df485a774ba59c3f43bfe84107672c1d9b731a0.tar.bz2 linux-2df485a774ba59c3f43bfe84107672c1d9b731a0.zip |
nfs: remove extraneous and problematic calls to nfs_clear_request
When a nfs_page is freed, nfs_free_request is called which also calls
nfs_clear_request to clean out the lock and open contexts and free the
pagecache page.
However, a couple of places in the nfs code call nfs_clear_request
themselves. What happens here if the refcount on the request is still high?
We'll be releasing contexts and freeing pointers while the request is
possibly still in use.
Remove those bare calls to nfs_clear_context. That should only be done when
the request is being freed.
Note that when doing this, we need to watch out for tests of req->wb_page.
Previously, nfs_set_page_tag_locked() and nfs_clear_page_tag_locked()
would check the value of req->wb_page to figure out if the page is mapped
into the nfsi->nfs_page_tree. We now indicate the page is mapped using
the new bit PG_MAPPED in req->wb_flags .
Reported-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/read.c')
-rw-r--r-- | fs/nfs/read.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index e4b62c6f5a6e..aedcaa7f291f 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -152,7 +152,6 @@ static void nfs_readpage_release(struct nfs_page *req) (long long)NFS_FILEID(req->wb_context->path.dentry->d_inode), req->wb_bytes, (long long)req_offset(req)); - nfs_clear_request(req); nfs_release_request(req); } |