| From 93a41a7fe3a515fc6e46c423d9cd672c6533dbc6 Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Thu, 7 Apr 2022 00:03:14 +0100 |
| Subject: cifs: Check the IOCB_DIRECT flag, not O_DIRECT |
| |
| From: David Howells <dhowells@redhat.com> |
| |
| [ 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> |
| --- |
| fs/cifs/cifsfs.c | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c |
| index 95e4f074b766..b85c283ad08b 100644 |
| --- a/fs/cifs/cifsfs.c |
| +++ b/fs/cifs/cifsfs.c |
| @@ -766,7 +766,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); |
| -- |
| 2.35.1 |
| |