aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index dc62bc504693..eea2d2b5278c 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -616,7 +616,7 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context* ctx,
616 spin_unlock(&inode->i_lock); 616 spin_unlock(&inode->i_lock);
617 radix_tree_preload_end(); 617 radix_tree_preload_end();
618 req = new; 618 req = new;
619 goto zero_page; 619 goto out;
620 } 620 }
621 spin_unlock(&inode->i_lock); 621 spin_unlock(&inode->i_lock);
622 622
@@ -649,19 +649,13 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context* ctx,
649 req->wb_offset = offset; 649 req->wb_offset = offset;
650 req->wb_pgbase = offset; 650 req->wb_pgbase = offset;
651 req->wb_bytes = max(end, rqend) - req->wb_offset; 651 req->wb_bytes = max(end, rqend) - req->wb_offset;
652 goto zero_page; 652 goto out;
653 } 653 }
654 654
655 if (end > rqend) 655 if (end > rqend)
656 req->wb_bytes = end - req->wb_offset; 656 req->wb_bytes = end - req->wb_offset;
657 657
658 return req; 658out:
659zero_page:
660 /* If this page might potentially be marked as up to date,
661 * then we need to zero any uninitalised data. */
662 if (req->wb_pgbase == 0 && req->wb_bytes != PAGE_CACHE_SIZE
663 && !PageUptodate(req->wb_page))
664 zero_user_segment(req->wb_page, req->wb_bytes, PAGE_CACHE_SIZE);
665 return req; 659 return req;
666} 660}
667 661