linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] NFS: Don't do a full flush to disk on close() if we hold a delegation
@ 2012-05-07 14:07 Trond Myklebust
  2012-05-07 14:07 ` [PATCH 2/3] NFS: nfs_inode_return_delegation() should always flush dirty data Trond Myklebust
  2012-05-07 14:48 ` [PATCH 1/3] NFS: Don't do a full flush to disk on close() if we hold a delegation Chuck Lever
  0 siblings, 2 replies; 5+ messages in thread
From: Trond Myklebust @ 2012-05-07 14:07 UTC (permalink / raw)
  To: linux-nfs

If we hold a delegation then we know that it should be safe to continue
to cache the data beyond the close(). However since the process that wrote
the data may die after close(), we may still want to send the data to
server before those RPCSEC_GSS credentials expire. We therefore compromise
by starting writeback to the server, but don't wait for completion.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---
 fs/nfs/file.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index aa9b709..8eda8a6 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -174,6 +174,13 @@ nfs_file_flush(struct file *file, fl_owner_t id)
 	if ((file->f_mode & FMODE_WRITE) == 0)
 		return 0;
 
+	/*
+	 * If we're holding a write delegation, then just start the i/o
+	 * but don't wait for completion (or send a commit).
+	 */
+	if (nfs_have_delegation(inode, FMODE_WRITE))
+		return filemap_fdatawrite(file->f_mapping);
+
 	/* Flush writes to the server and return any errors */
 	return vfs_fsync(file, 0);
 }
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-07 14:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-07 14:07 [PATCH 1/3] NFS: Don't do a full flush to disk on close() if we hold a delegation Trond Myklebust
2012-05-07 14:07 ` [PATCH 2/3] NFS: nfs_inode_return_delegation() should always flush dirty data Trond Myklebust
2012-05-07 14:07   ` [PATCH 3/3] NFSv4: nfs_client_return_marked_delegations can't flush data Trond Myklebust
2012-05-07 14:48 ` [PATCH 1/3] NFS: Don't do a full flush to disk on close() if we hold a delegation Chuck Lever
2012-05-07 14:53   ` Myklebust, Trond

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).