Steve French dca692880e [CIFS] O_DIRECT opens should work on directio mounts
Opens on current cifs/smb2/smb3 mounts with O_DIRECT flag fail
even when caching is disabled on the mount.  This was
reported by those running SMB2 benchmarks who need to
be able to pass O_DIRECT on many of their open calls to
reduce caching effects, but would also be needed by other
applications.

When mounting with forcedirectio ("cache=none") cifs and smb2/smb3
do not go through the page cache and thus opens with O_DIRECT flag
should work (when posix extensions are negotiated we even are
able to send the flag to the server). This patch fixes that
in a simple way.

The 9P client has a similar situation (caching is often disabled)
and takes the same approach to O_DIRECT support ie works if caching
disabled, but if client caching enabled it fails with EINVAL.

A followon idea for a future patch as Pavel noted, could
be that files opened with O_DIRECT could cause us to change
inode->i_fop on the fly from

cifs_file_strict_ops

to

cifs_file_direct_ops

which would allow us to support this on non-forcedirectio mounts
(cache=strict and cache=loose) as well.

Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <smfrench@gmail.com>
2013-11-11 16:42:37 -06:00
..
2013-09-25 19:01:27 -05:00
2013-11-11 16:31:03 -06:00
2013-11-08 05:57:46 +09:00
2013-11-11 16:31:03 -06:00
2013-06-26 23:45:05 -05:00
2013-09-08 14:27:34 -05:00
2013-11-11 16:31:03 -06:00
2007-06-05 18:30:44 +00:00
2013-11-11 16:31:03 -06:00
2013-06-26 23:45:05 -05:00
2013-11-11 16:31:03 -06:00
2013-11-02 12:52:41 -05:00
2013-11-11 16:31:03 -06:00
2012-07-24 10:25:13 -05:00
2013-09-08 14:54:24 -05:00