Skip to content

Commit

Permalink
SMB3: Don't ignore O_SYNC/O_DSYNC and O_DIRECT flags
Browse files Browse the repository at this point in the history
Signed-off-by: Steve French <[email protected]>
CC: Stable <[email protected]>
Reviewed-by: Ronnie Sahlberg <[email protected]>
Reviewed-by: Pavel Shilovsky <[email protected]>
  • Loading branch information
smfrench committed Sep 23, 2017
1 parent 6e70e26 commit 1013e76
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1013e76

Please sign in to comment.