All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zheng Liu <gnehzuil.liu@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: linux-fsdevel@vger.kernel.org,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Zheng Liu <wenqing.lz@taobao.com>
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	[thread overview]
Message-ID: <20131128022903.GB4019@gmail.com> (raw)
In-Reply-To: <20131127230359.GD27330@quack.suse.cz>

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@zeniv.linux.org.uk>
> > Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
> > ---
> >  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 <jack@suse.cz>
> SUSE Labs, CR

  reply	other threads:[~2013-11-28  2:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-21  8:34 [RFC][PATCH] vfs: don't fallback to buffered read if the offset of dio read is beyond eof Zheng Liu
2013-11-27 23:03 ` Jan Kara
2013-11-28  2:29   ` Zheng Liu [this message]
2013-12-16  7:21 ` Andrew Morton
2013-12-16 15:01   ` Zheng Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131128022903.GB4019@gmail.com \
    --to=gnehzuil.liu@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=wenqing.lz@taobao.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.