From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:58928 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750929AbdJBMmZ (ORCPT ); Mon, 2 Oct 2017 08:42:25 -0400 Subject: Patch "SMB3: Don't ignore O_SYNC/O_DSYNC and O_DIRECT flags" has been added to the 3.18-stable tree To: smfrench@gmail.com, gregkh@linuxfoundation.org, lsahlber@redhat.com, pshilov@microsoft.com Cc: , From: Date: Mon, 02 Oct 2017 14:42:24 +0200 Message-ID: <1506948143223255@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled SMB3: Don't ignore O_SYNC/O_DSYNC and O_DIRECT flags to the 3.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: smb3-don-t-ignore-o_sync-o_dsync-and-o_direct-flags.patch and it can be found in the queue-3.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 1013e760d10e614dc10b5624ce9fc41563ba2e65 Mon Sep 17 00:00:00 2001 From: Steve French Date: Fri, 22 Sep 2017 01:40:27 -0500 Subject: SMB3: Don't ignore O_SYNC/O_DSYNC and O_DIRECT flags From: Steve French commit 1013e760d10e614dc10b5624ce9fc41563ba2e65 upstream. Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg Reviewed-by: Pavel Shilovsky Signed-off-by: Greg Kroah-Hartman --- fs/cifs/file.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -225,6 +225,13 @@ cifs_nt_open(char *full_path, struct ino 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; Patches currently in stable-queue which might be from smfrench@gmail.com are queue-3.18/cifs-release-cifs-root_cred-after-exit_cifs.patch queue-3.18/smb3-don-t-ignore-o_sync-o_dsync-and-o_direct-flags.patch queue-3.18/cifs-release-auth_key.response-for-reconnect.patch queue-3.18/smb-validate-negotiate-to-protect-against-downgrade-even-if-signing-off.patch