From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zheng Liu Subject: Re: [RFC][PATCH] vfs: don't fallback to buffered read if the offset of dio read is beyond eof Date: Thu, 28 Nov 2013 10:29:03 +0800 Message-ID: <20131128022903.GB4019@gmail.com> References: <1385022854-2683-1-git-send-email-wenqing.lz@taobao.com> <20131127230359.GD27330@quack.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, Alexander Viro , Zheng Liu To: Jan Kara Return-path: Received: from mail-pb0-f44.google.com ([209.85.160.44]:60834 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754561Ab3K1C0N (ORCPT ); Wed, 27 Nov 2013 21:26:13 -0500 Received: by mail-pb0-f44.google.com with SMTP id rq2so11681452pbb.3 for ; Wed, 27 Nov 2013 18:26:13 -0800 (PST) Content-Disposition: inline In-Reply-To: <20131127230359.GD27330@quack.suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 > > Signed-off-by: Zheng Liu > > --- > > 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@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- > Jan Kara > SUSE Labs, CR