aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-28 10:52:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-28 10:52:58 -0400
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
192 auth = rpcauth_create(flavor, clone); 192 auth = rpcauth_create(flavor, clone);
193 if (!auth) { 193 if (!auth) {
194 flavor = -EIO; 194 flavor = -EIO;
195 goto out; 195 goto out_shutdown;
196 } 196 }
197 err = server->nfs_client->rpc_ops->lookup(clone, parent->d_inode, 197 err = server->nfs_client->rpc_ops->lookup(clone, parent->d_inode,
198 &path->dentry->d_name, 198 &path->dentry->d_name,
199 fh, fattr); 199 fh, fattr);
200 if (err < 0) 200 if (err < 0)
201 flavor = err; 201 flavor = err;
202out_shutdown:
203 rpc_shutdown_client(clone);
202out: 204out:
203 return flavor; 205 return flavor;
204} 206}
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)
135 nfs_unlock_request(req); 135 nfs_unlock_request(req);
136} 136}
137 137
138/** 138/*
139 * nfs_clear_request - Free up all resources allocated to the request 139 * nfs_clear_request - Free up all resources allocated to the request
140 * @req: 140 * @req:
141 * 141 *
142 * Release page and open context resources associated with a read/write 142 * Release page and open context resources associated with a read/write
143 * request after it has completed. 143 * request after it has completed.
144 */ 144 */
145void nfs_clear_request(struct nfs_page *req) 145static void nfs_clear_request(struct nfs_page *req)
146{ 146{
147 struct page *page = req->wb_page; 147 struct page *page = req->wb_page;
148 struct nfs_open_context *ctx = req->wb_context; 148 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)
389 spin_lock(&inode->i_lock); 389 spin_lock(&inode->i_lock);
390 error = radix_tree_insert(&nfsi->nfs_page_tree, req->wb_index, req); 390 error = radix_tree_insert(&nfsi->nfs_page_tree, req->wb_index, req);
391 BUG_ON(error); 391 BUG_ON(error);
392 if (!nfsi->npages) { 392 if (!nfsi->npages && nfs_have_delegation(inode, FMODE_WRITE))
393 igrab(inode); 393 nfsi->change_attr++;
394 if (nfs_have_delegation(inode, FMODE_WRITE))
395 nfsi->change_attr++;
396 }
397 set_bit(PG_MAPPED, &req->wb_flags); 394 set_bit(PG_MAPPED, &req->wb_flags);
398 SetPagePrivate(req->wb_page); 395 SetPagePrivate(req->wb_page);
399 set_page_private(req->wb_page, (unsigned long)req); 396 set_page_private(req->wb_page, (unsigned long)req);
@@ -423,11 +420,7 @@ static void nfs_inode_remove_request(struct nfs_page *req)
423 clear_bit(PG_MAPPED, &req->wb_flags); 420 clear_bit(PG_MAPPED, &req->wb_flags);
424 radix_tree_delete(&nfsi->nfs_page_tree, req->wb_index); 421 radix_tree_delete(&nfsi->nfs_page_tree, req->wb_index);
425 nfsi->npages--; 422 nfsi->npages--;
426 if (!nfsi->npages) { 423 spin_unlock(&inode->i_lock);
427 spin_unlock(&inode->i_lock);
428 iput(inode);
429 } else
430 spin_unlock(&inode->i_lock);
431 nfs_release_request(req); 424 nfs_release_request(req);
432} 425}
433 426