File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -2740,9 +2740,7 @@ generic_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
2740
2740
struct file * file = iocb -> ki_filp ;
2741
2741
struct address_space * mapping = file -> f_mapping ;
2742
2742
struct inode * inode = mapping -> host ;
2743
- loff_t size ;
2744
2743
2745
- size = i_size_read (inode );
2746
2744
if (iocb -> ki_flags & IOCB_NOWAIT ) {
2747
2745
if (filemap_range_needs_writeback (mapping , iocb -> ki_pos ,
2748
2746
iocb -> ki_pos + count - 1 ))
@@ -2774,8 +2772,9 @@ generic_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
2774
2772
* the rest of the read. Buffered reads will not work for
2775
2773
* DAX files, so don't bother trying.
2776
2774
*/
2777
- if (retval < 0 || !count || iocb -> ki_pos >= size ||
2778
- IS_DAX (inode ))
2775
+ if (retval < 0 || !count || IS_DAX (inode ))
2776
+ return retval ;
2777
+ if (iocb -> ki_pos >= i_size_read (inode ))
2779
2778
return retval ;
2780
2779
}
2781
2780
You can’t perform that action at this time.
0 commit comments