Merge git://git.linux-nfs.org/pub/linux/nfs-2.6

* git://git.linux-nfs.org/pub/linux/nfs-2.6:
SUNRPC xptrdma: simplify build configuration
NFS: Fix a potential file corruption issue when writing

+19 -8
+2 -5
fs/Kconfig
··· 1778 tristate 1779 1780 config SUNRPC_XPRT_RDMA 1781 - tristate "RDMA transport for sunrpc (EXPERIMENTAL)" 1782 depends on SUNRPC && INFINIBAND && EXPERIMENTAL 1783 - default m 1784 - help 1785 - Adds a client RPC transport for supporting kernel NFS over RDMA 1786 - mounts, including Infiniband and iWARP. Experimental. 1787 1788 config SUNRPC_BIND34 1789 bool "Support for rpcbind versions 3 & 4 (EXPERIMENTAL)"
··· 1778 tristate 1779 1780 config SUNRPC_XPRT_RDMA 1781 + tristate 1782 depends on SUNRPC && INFINIBAND && EXPERIMENTAL 1783 + default SUNRPC && INFINIBAND 1784 1785 config SUNRPC_BIND34 1786 bool "Support for rpcbind versions 3 & 4 (EXPERIMENTAL)"
+17 -3
fs/nfs/write.c
··· 697 } 698 699 /* 700 * Update and possibly write a cached page of an NFS file. 701 * 702 * XXX: Keep an eye on generic_file_read to make sure it doesn't do bad ··· 728 (long long)(page_offset(page) +offset)); 729 730 /* If we're not using byte range locks, and we know the page 731 - * is entirely in cache, it may be more efficient to avoid 732 - * fragmenting write requests. 733 */ 734 - if (PageUptodate(page) && inode->i_flock == NULL && !(file->f_mode & O_SYNC)) { 735 count = max(count + offset, nfs_page_length(page)); 736 offset = 0; 737 }
··· 697 } 698 699 /* 700 + * If the page cache is marked as unsafe or invalid, then we can't rely on 701 + * the PageUptodate() flag. In this case, we will need to turn off 702 + * write optimisations that depend on the page contents being correct. 703 + */ 704 + static int nfs_write_pageuptodate(struct page *page, struct inode *inode) 705 + { 706 + return PageUptodate(page) && 707 + !(NFS_I(inode)->cache_validity & (NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA)); 708 + } 709 + 710 + /* 711 * Update and possibly write a cached page of an NFS file. 712 * 713 * XXX: Keep an eye on generic_file_read to make sure it doesn't do bad ··· 717 (long long)(page_offset(page) +offset)); 718 719 /* If we're not using byte range locks, and we know the page 720 + * is up to date, it may be more efficient to extend the write 721 + * to cover the entire page in order to avoid fragmentation 722 + * inefficiencies. 723 */ 724 + if (nfs_write_pageuptodate(page, inode) && 725 + inode->i_flock == NULL && 726 + !(file->f_mode & O_SYNC)) { 727 count = max(count + offset, nfs_page_length(page)); 728 offset = 0; 729 }