summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorSteve French <smfrench@gmail.com>2017-09-22 01:40:27 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-05 09:44:01 +0200
commit18a89a10b26b325da5eb03cbd275f835a4a704f5 (patch)
tree7402bae036548a126c6aea51a93c22a3f6585972 /fs/cifs
parent0e1b85a41a25ac888fb64a60ad2949dbc2ab61ed (diff)
downloadlinux-stable-18a89a10b26b325da5eb03cbd275f835a4a704f5.tar.gz
linux-stable-18a89a10b26b325da5eb03cbd275f835a4a704f5.tar.bz2
linux-stable-18a89a10b26b325da5eb03cbd275f835a4a704f5.zip
SMB3: Don't ignore O_SYNC/O_DSYNC and O_DIRECT flags
commit 1013e760d10e614dc10b5624ce9fc41563ba2e65 upstream. Signed-off-by: Steve French <smfrench@gmail.com> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com> Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/file.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 3925758f6dde..cf192f9ce254 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -224,6 +224,13 @@ cifs_nt_open(char *full_path, struct inode *inode, struct cifs_sb_info *cifs_sb,
if (backup_cred(cifs_sb))
create_options |= CREATE_OPEN_BACKUP_INTENT;
+ /* O_SYNC also has bit for O_DSYNC so following check picks up either */
+ if (f_flags & O_SYNC)
+ create_options |= CREATE_WRITE_THROUGH;
+
+ if (f_flags & O_DIRECT)
+ create_options |= CREATE_NO_BUFFER;
+
oparms.tcon = tcon;
oparms.cifs_sb = cifs_sb;
oparms.desired_access = desired_access;