From be652445fdccb8e5d4391928c3b45324ea37f9e1 Mon Sep 17 00:00:00 2001 From: Steve French Date: Mon, 23 Feb 2009 15:21:59 +0000 Subject: [CIFS] Add new nostrictsync cifs mount option to avoid slow SMB flush If this mount option is set, when an application does an fsync call then the cifs client does not send an SMB Flush to the server (to force the server to write all dirty data for this file immediately to disk), although cifs still sends all dirty (cached) file data to the server and waits for the server to respond to the write write. Since SMB Flush can be very slow, and some servers may be reliable enough (to risk delaying slightly flushing the data to disk on the server), turning on this option may be useful to improve performance for applications that fsync too much, at a small risk of server crash. If this mount option is not set, by default cifs will send an SMB flush request (and wait for a response) on every fsync call. Signed-off-by: Steve French --- fs/cifs/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fs/cifs/file.c') diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 83b4741b..6411f5f 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -1538,7 +1538,8 @@ int cifs_fsync(struct file *file, struct dentry *dentry, int datasync) rc = CIFS_I(inode)->write_behind_rc; CIFS_I(inode)->write_behind_rc = 0; tcon = CIFS_SB(inode->i_sb)->tcon; - if (!rc && tcon && smbfile) + if (!rc && tcon && smbfile && + !(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_SSYNC)) rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); } -- cgit v1.1