xfs
[Top] [All Lists]

Re: AIO read returns negative number for bytes read

To: Alireza Haghdoost <haghdoost@xxxxxxxxx>
Subject: Re: AIO read returns negative number for bytes read
From: Avi Kivity <avi@xxxxxxxxxxxx>
Date: Mon, 16 Nov 2015 17:32:53 +0200
Cc: xfs@xxxxxxxxxxx, linux-aio@xxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scylladb_com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=7OXH7lNWoKJqVEFXxfLn/O9JBABznYSl4we1kyN8ktM=; b=xzsSMcpYy8ceZ63q7jvUXL7gNI80i0sYz+MDVECUOziKGKQNf0ESI5SBkZuaYzZSJG fTbmZJEApBcfQtQzH2B5T3VKiVQWXbhx/M8i1tpP9ALOOokg30B5/SljXz3dQBPOukHI UTczVZHDAXhV1HkjC0hbClgGti0KD9A9INy70y0iidGmHAhUhp2wvHcvCUE74BdOXDaf OgyLlsSwuWg/CnzM/OOuQsBXIj9MSi1P7oykgunWFy+mBK6HO4a0n0wV9mVl+Xb4f3R2 grMDD5hI877PS7rFB+BuMDOmwPJbxnsdVsHhVYTpvEbPus7k1tJTViempXbZf0DKY2qZ uWsA==
In-reply-to: <CAB-428nQfSdBpLkANvEoWjsJhV=6KbQD2wQ7hJbXmHh-GgjyTQ@xxxxxxxxxxxxxx>
References: <564883BD.8070607@xxxxxxxxxxxx> <CAB-428nQfSdBpLkANvEoWjsJhV=6KbQD2wQ7hJbXmHh-GgjyTQ@xxxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


On 11/16/2015 05:19 PM, Alireza Haghdoost wrote:
On Sun, Nov 15, 2015 at 7:08 AM, Avi Kivity <avi@xxxxxxxxxxxx> wrote:
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?
I think it is not a bug. This post might be helpful:
http://marc.info/?l=linux-aio&m=142315449930935&w=2

The post indicates that it is a bug. A negative value indicates an error, but there is no error 310.

<Prev in Thread] Current Thread [Next in Thread>