* Fwd: [SMB3] Handle O_SYNC/DSYNC and O_DIRECT flags on SMB3 opens [not found] ` <CAH2r5msgp0GsR8zj9ku7CKHB2amUavj1Bd42YELYUqTcVtJ0EA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2017-09-22 6:47 ` Steve French [not found] ` <CAH2r5mv4ZN9dtpmhDk8_enVPwJqPBoewrVBtV6Hv64QE+saj5Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Steve French @ 2017-09-22 6:47 UTC (permalink / raw) To: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [-- Attachment #1: Type: text/plain, Size: 469 bytes --] ---------- Forwarded message ---------- From: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Date: Fri, Sep 22, 2017 at 1:43 AM Subject: [SMB3] Handle O_SYNC/DSYNC and O_DIRECT flags on SMB3 opens To: "linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" <linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> We were only handling them on CIFS POSIX/Unix mounts. Fix them for SMB3 (and non-POSIX CIFS) mounts -- Thanks, Steve -- Thanks, Steve [-- Attachment #2: 0001-SMB3-Ensure-that-O_SYNC-O_DSYNC-and-O_DIRECT-flags-a.patch --] [-- Type: text/x-patch, Size: 1010 bytes --] From bea99ab733f033c2dcedb8b604963462fa2d4062 Mon Sep 17 00:00:00 2001 From: Steve French <smfrench@gmail.com> Date: Fri, 22 Sep 2017 01:40:27 -0500 Subject: [PATCH] [SMB3] Ensure that O_SYNC/O_DSYNC and O_DIRECT flags are honored on SMB3 mounts Signed-off-by: Steve French <smfrench@gmail.com> CC: Stable <stable@vger.kernel.org> --- fs/cifs/file.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 8223119..92fdf9c 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; -- 2.7.4 ^ permalink raw reply related [flat|nested] 3+ messages in thread
[parent not found: <CAH2r5mv4ZN9dtpmhDk8_enVPwJqPBoewrVBtV6Hv64QE+saj5Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [SMB3] Handle O_SYNC/DSYNC and O_DIRECT flags on SMB3 opens [not found] ` <CAH2r5mv4ZN9dtpmhDk8_enVPwJqPBoewrVBtV6Hv64QE+saj5Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2017-09-22 6:50 ` Leif Sahlberg [not found] ` <2120555110.8699523.1506063009492.JavaMail.zimbra-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Leif Sahlberg @ 2017-09-22 6:50 UTC (permalink / raw) To: Steve French; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA Looks sane to me. Rewieved-by: Ronnie Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> ----- Original Message ----- From: "Steve French" <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> To: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Sent: Friday, 22 September, 2017 4:47:46 PM Subject: Fwd: [SMB3] Handle O_SYNC/DSYNC and O_DIRECT flags on SMB3 opens ---------- Forwarded message ---------- From: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Date: Fri, Sep 22, 2017 at 1:43 AM Subject: [SMB3] Handle O_SYNC/DSYNC and O_DIRECT flags on SMB3 opens To: "linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" <linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> We were only handling them on CIFS POSIX/Unix mounts. Fix them for SMB3 (and non-POSIX CIFS) mounts -- Thanks, Steve -- Thanks, Steve ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <2120555110.8699523.1506063009492.JavaMail.zimbra-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: [SMB3] Handle O_SYNC/DSYNC and O_DIRECT flags on SMB3 opens [not found] ` <2120555110.8699523.1506063009492.JavaMail.zimbra-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2017-09-22 23:50 ` Pavel Shilovsky 0 siblings, 0 replies; 3+ messages in thread From: Pavel Shilovsky @ 2017-09-22 23:50 UTC (permalink / raw) To: Leif Sahlberg; +Cc: Steve French, linux-cifs 2017-09-21 23:50 GMT-07:00 Leif Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>: > Looks sane to me. > > Rewieved-by: Ronnie Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > > > ----- Original Message ----- > From: "Steve French" <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > To: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Sent: Friday, 22 September, 2017 4:47:46 PM > Subject: Fwd: [SMB3] Handle O_SYNC/DSYNC and O_DIRECT flags on SMB3 opens > > ---------- Forwarded message ---------- > From: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > Date: Fri, Sep 22, 2017 at 1:43 AM > Subject: [SMB3] Handle O_SYNC/DSYNC and O_DIRECT flags on SMB3 opens > To: "linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" <linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> > > > We were only handling them on CIFS POSIX/Unix mounts. > > Fix them for SMB3 (and non-POSIX CIFS) mounts > > > > -- > Thanks, > > Steve > > > -- > Thanks, > > Steve > -- > To unsubscribe from this list: send the line "unsubscribe linux-cifs" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Looks good. Reviewed-by: Pavel Shilovsky <pshilov-0li6OtcxBFHby3iVrkZq2A@public.gmane.org> -- Best regards, Pavel Shilovsky ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-22 23:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAH2r5msgp0GsR8zj9ku7CKHB2amUavj1Bd42YELYUqTcVtJ0EA@mail.gmail.com>
[not found] ` <CAH2r5msgp0GsR8zj9ku7CKHB2amUavj1Bd42YELYUqTcVtJ0EA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-22 6:47 ` Fwd: [SMB3] Handle O_SYNC/DSYNC and O_DIRECT flags on SMB3 opens Steve French
[not found] ` <CAH2r5mv4ZN9dtpmhDk8_enVPwJqPBoewrVBtV6Hv64QE+saj5Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-22 6:50 ` Leif Sahlberg
[not found] ` <2120555110.8699523.1506063009492.JavaMail.zimbra-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-09-22 23:50 ` Pavel Shilovsky
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox