Hi Jan, On Thu, Nov 28, 2013 at 12:03:59AM +0100, Jan Kara wrote: [...] > > This commit let dio read return directly if the current offset of the > > dio read is beyond the end of file in order to avoid this problem. > This would be OK as well but it doesn't solve the case when the reader > uses a normal buffered read, does it? Yup, it doesn't fix that case with buffered read because as Dave's comment we shouldn't need to ensure that. So in this commit I just try to fix the dio case. > So I think trimming read count as I > described as a reply to your previous patch might be still better. I have seen your reply. Thanks for your suggestion, and I will give it a try. - Zheng > > Honza > > > > > Cc: Alexander Viro <viro@xxxxxxxxxxxxxxxxxx> > > Signed-off-by: Zheng Liu <wenqing.lz@xxxxxxxxxx> > > --- > > mm/filemap.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/mm/filemap.c b/mm/filemap.c > > index 1e6aec4..4179249 100644 > > --- a/mm/filemap.c > > +++ b/mm/filemap.c > > @@ -1452,6 +1452,8 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov, > > file_accessed(filp); > > goto out; > > } > > + } else { > > + goto out; > > } > > } > > > > -- > > 1.7.9.7 > > > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in > > the body of a message to majordomo@xxxxxxxxxxxxxxx > > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- > Jan Kara <jack@xxxxxxx> > SUSE Labs, CR -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html