summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2022-04-07 00:03:14 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-27 13:39:43 +0200
commit6f75b74dc80a7a2b03c00169543db65c4446bc45 (patch)
tree0ec4b4b2443e0c8475f0d0d1433a49a71f33aa4c
parent2b3b16f30c85f5bf4ad61caa51d1e38f24087ad6 (diff)
downloadlinux-stable-6f75b74dc80a7a2b03c00169543db65c4446bc45.tar.gz
linux-stable-6f75b74dc80a7a2b03c00169543db65c4446bc45.tar.bz2
linux-stable-6f75b74dc80a7a2b03c00169543db65c4446bc45.zip
cifs: Check the IOCB_DIRECT flag, not O_DIRECT
[ Upstream commit 994fd530a512597ffcd713b0f6d5bc916c5698f0 ] Use the IOCB_DIRECT indicator flag on the I/O context rather than checking to see if the file was opened O_DIRECT. Signed-off-by: David Howells <dhowells@redhat.com> cc: Steve French <sfrench@samba.org> cc: Shyam Prasad N <nspmangalore@gmail.com> cc: Rohith Surabattula <rohiths.msft@gmail.com> cc: linux-cifs@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/cifs/cifsfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index baa1713d6695..52b1524b40cd 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -813,7 +813,7 @@ cifs_loose_read_iter(struct kiocb *iocb, struct iov_iter *iter)
ssize_t rc;
struct inode *inode = file_inode(iocb->ki_filp);
- if (iocb->ki_filp->f_flags & O_DIRECT)
+ if (iocb->ki_flags & IOCB_DIRECT)
return cifs_user_readv(iocb, iter);
rc = cifs_revalidate_mapping(inode);