From: Trond Myklebust Date: Sun, 29 Apr 2012 16:50:01 +0000 (-0400) Subject: NFS: Always trust the PageUptodate flag when we have a delegation X-Git-Tag: firefly_0821_release~3680^2~2730^2~98 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8d197a568;p=firefly-linux-kernel-4.4.55.git NFS: Always trust the PageUptodate flag when we have a delegation We can always use the optimal full page write if we know that we hold a delegation. Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/write.c b/fs/nfs/write.c index d1e4f81ba057..6f263daac748 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -850,10 +850,14 @@ int nfs_flush_incompatible(struct file *file, struct page *page) * the PageUptodate() flag. In this case, we will need to turn off * write optimisations that depend on the page contents being correct. */ -static int nfs_write_pageuptodate(struct page *page, struct inode *inode) +static bool nfs_write_pageuptodate(struct page *page, struct inode *inode) { - return PageUptodate(page) && - !(NFS_I(inode)->cache_validity & (NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA)); + if (nfs_have_delegated_attributes(inode)) + goto out; + if (NFS_I(inode)->cache_validity & NFS_INO_REVAL_PAGECACHE) + return false; +out: + return PageUptodate(page) != 0; } /*