aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-06-05 15:17:39 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-07-09 12:08:39 -0400
commitf3d47a3a6a1484a93c8cfe1e8c8d4399c95199c7 (patch)
tree639d104b0e66dc3bf143bf0010fb5954dc3e7b37 /fs/nfs/write.c
parent0b4aae7aad162ad175ba8a65708332f888066b26 (diff)
NFS: Fix a preemption count leak in nfs_update_request
The commit 2785259631697ebb0749a3782cca206e2e542939 (nfs: use GFP_NOFS preloads for radix-tree insertion) appears to have introduced a bug: We only want to call radix_tree_preload() once after creating a request. Calling it every time we loop after we created the request, will cause preemption count leaks. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Nick Piggin <npiggin@suse.de>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index f333848fd3be..dc62bc504693 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -584,13 +584,6 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context* ctx,
584 /* Loop over all inode entries and see if we find 584 /* Loop over all inode entries and see if we find
585 * A request for the page we wish to update 585 * A request for the page we wish to update
586 */ 586 */
587 if (new) {
588 if (radix_tree_preload(GFP_NOFS)) {
589 nfs_release_request(new);
590 return ERR_PTR(-ENOMEM);
591 }
592 }
593
594 spin_lock(&inode->i_lock); 587 spin_lock(&inode->i_lock);
595 req = nfs_page_find_request_locked(page); 588 req = nfs_page_find_request_locked(page);
596 if (req) { 589 if (req) {
@@ -630,6 +623,10 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context* ctx,
630 new = nfs_create_request(ctx, inode, page, offset, bytes); 623 new = nfs_create_request(ctx, inode, page, offset, bytes);
631 if (IS_ERR(new)) 624 if (IS_ERR(new))
632 return new; 625 return new;
626 if (radix_tree_preload(GFP_NOFS)) {
627 nfs_release_request(new);
628 return ERR_PTR(-ENOMEM);
629 }
633 } 630 }
634 631
635 /* We have a request for our page. 632 /* We have a request for our page.