提交 77759771 编写于 作者: Y Yang Sheng 提交者: Greg Kroah-Hartman

staging: lustre: llite: don't invoke direct_IO for the EOF case

The function generic_file_read_iter() does not check EOF
before invoke direct_IO callback. So we have to check it
ourselves.
Signed-off-by: NYang Sheng <yang.sheng@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8969
Reviewed-on: https://review.whamcloud.com/24552Reviewed-by: NBob Glossman <bob.glossman@intel.com>
Reviewed-by: NBobi Jam <bobijam@hotmail.com>
Reviewed-by: NOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: NJames Simmons <jsimmons@infradead.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 62898c2d
...@@ -345,6 +345,10 @@ static ssize_t ll_direct_IO_26(struct kiocb *iocb, struct iov_iter *iter) ...@@ -345,6 +345,10 @@ static ssize_t ll_direct_IO_26(struct kiocb *iocb, struct iov_iter *iter)
ssize_t tot_bytes = 0, result = 0; ssize_t tot_bytes = 0, result = 0;
long size = MAX_DIO_SIZE; long size = MAX_DIO_SIZE;
/* Check EOF by ourselves */
if (iov_iter_rw(iter) == READ && file_offset >= i_size_read(inode))
return 0;
/* FIXME: io smaller than PAGE_SIZE is broken on ia64 ??? */ /* FIXME: io smaller than PAGE_SIZE is broken on ia64 ??? */
if ((file_offset & ~PAGE_MASK) || (count & ~PAGE_MASK)) if ((file_offset & ~PAGE_MASK) || (count & ~PAGE_MASK))
return -EINVAL; return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册