summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-28 07:52:58 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-28 07:52:58 -0700
commit1788c208aab15f9d9d1d24cff0d0c64b5c73bbee (patch)
treefaf11b0fe60042af282a57f339031728dda28594 /fs
parent15b7cf1416c0e3ae6163ade3349d717fe2729952 (diff)
parenta271c5a0dea418931b6a903ef85adc30ad4c54be (diff)
Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: NFS: Ensure that rpc_release_resources_task() can be called twice. NFS: Don't leak RPC clients in NFSv4 secinfo negotiation NFS: Fix a hang in the writeback path
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/namespace.c4
-rw-r--r--fs/nfs/pagelist.c4
-rw-r--r--fs/nfs/write.c13
3 files changed, 8 insertions, 13 deletions
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
index ad92bf731ff5..9166fcb66da2 100644
--- a/fs/nfs/namespace.c
+++ b/fs/nfs/namespace.c
@@ -192,13 +192,15 @@ static rpc_authflavor_t nfs_lookup_with_sec(struct nfs_server *server, struct de
auth = rpcauth_create(flavor, clone);
if (!auth) {
flavor = -EIO;
- goto out;
+ goto out_shutdown;
}
err = server->nfs_client->rpc_ops->lookup(clone, parent->d_inode,
&path->dentry->d_name,
fh, fattr);
if (err < 0)
flavor = err;
+out_shutdown:
+ rpc_shutdown_client(clone);
out:
return flavor;
}
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 87a593c2b055..c80add6e2213 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -135,14 +135,14 @@ void nfs_clear_page_tag_locked(struct nfs_page *req)
nfs_unlock_request(req);
}
-/**
+/*
* nfs_clear_request - Free up all resources allocated to the request
* @req:
*
* Release page and open context resources associated with a read/write
* request after it has completed.
*/
-void nfs_clear_request(struct nfs_page *req)
+static void nfs_clear_request(struct nfs_page *req)
{
struct page *page = req->wb_page;
struct nfs_open_context *ctx = req->wb_context;
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 85d75254328e..af0c6279a4a7 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -389,11 +389,8 @@ static int nfs_inode_add_request(struct inode *inode, struct nfs_page *req)
spin_lock(&inode->i_lock);
error = radix_tree_insert(&nfsi->nfs_page_tree, req->wb_index, req);
BUG_ON(error);
- if (!nfsi->npages) {
- igrab(inode);
- if (nfs_have_delegation(inode, FMODE_WRITE))
- nfsi->change_attr++;
- }
+ if (!nfsi->npages && nfs_have_delegation(inode, FMODE_WRITE))
+ nfsi->change_attr++;
set_bit(PG_MAPPED, &req->wb_flags);
SetPagePrivate(req->wb_page);
set_page_private(req->wb_page, (unsigned long)req);
@@ -423,11 +420,7 @@ static void nfs_inode_remove_request(struct nfs_page *req)
clear_bit(PG_MAPPED, &req->wb_flags);
radix_tree_delete(&nfsi->nfs_page_tree, req->wb_index);
nfsi->npages--;
- if (!nfsi->npages) {
- spin_unlock(&inode->i_lock);
- iput(inode);
- } else
- spin_unlock(&inode->i_lock);
+ spin_unlock(&inode->i_lock);
nfs_release_request(req);
}