From: Jan Kara <jack@suse.cz>
To: Avi Kivity <avi@scylladb.com>
Cc: Jeff Moyer <jmoyer@redhat.com>,
xfs@oss.sgi.com, linux-aio@kvack.org,
Steven Whitehouse <swhiteho@redhat.com>, Jan Kara <jack@suse.cz>,
linux-fsdevel@vger.kernel.org
Subject: Re: AIO read returns negative number for bytes read
Date: Thu, 19 Nov 2015 16:30:04 +0100 [thread overview]
Message-ID: <20151119153004.GB25804@quack.suse.cz> (raw)
In-Reply-To: <564B2303.7000902@scylladb.com>
On Tue 17-11-15 14:52:19, Avi Kivity wrote:
>
>
> On 11/16/2015 09:27 PM, Jeff Moyer wrote:
> >Hi Avi,
> >
> >Avi Kivity <avi@scylladb.com> writes:
> >
> >>Due to a bug in my program, I initiated a read beyond
> >>eof. Specifically, the file size is 13002 bytes and the read offset is
> >>13312 (0x3400).
> >>
> >>I would expect such a read to return 0 bytes read, but io_getevents
> >>returns -310, which is suspiciously equal to (13002 - 13312).
> >>
> >>I attach a reproducer.
> >>
> >>4.2.5-201.fc22.x86_64
> >>
> >>Are my expectations incorrect, or is this a bug in aio or xfs?
> >Your expectations are correct. The bug was introduced by commit
> >9fe55eea7e4b4 (Fix race when checking i_size on direct i/o read). I've
> >CC'd the patch author and linux-fsdevel. I'm not sure what the right
> >fix is, given that the size checks were removed from the vfs to fix some
> >race condition. Unfortunately, the commit message doesn't really do a
> >good job of explaining the race. In order to save others time, here is
> >a good explanation of the problem that commit is meant to fix, along
> >with a reproducer:
> > http://marc.info/?l=linux-fsdevel&m=138641356614458&w=2
> >
> >Thanks for the great bug report, and sorry I have no solution to
> >proffer.
> >
>
> Thanks. I will await a fix with interest.
Can you please post the reproduce here as well? I couldn't easily find it
with google.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2015-11-19 15:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <564883BD.8070607@scylladb.com>
2015-11-16 19:27 ` AIO read returns negative number for bytes read Jeff Moyer
2015-11-17 12:52 ` Avi Kivity
2015-11-19 15:30 ` Jan Kara [this message]
2015-11-19 15:32 ` Avi Kivity
2015-11-19 15:33 ` Jeff Moyer
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=20151119153004.GB25804@quack.suse.cz \
--to=jack@suse.cz \
--cc=avi@scylladb.com \
--cc=jmoyer@redhat.com \
--cc=linux-aio@kvack.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=swhiteho@redhat.com \
--cc=xfs@oss.sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).