Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1697480 > unrolled thread

nowait aio return value

Started byJason Baron <jbaron@akamai.com>
First post2017-07-26 20:50 +0200
Last post2017-07-26 23:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  nowait aio return value Jason Baron <jbaron@akamai.com> - 2017-07-26 20:50 +0200
    Re: nowait aio return value Goldwyn Rodrigues <rgoldwyn@suse.de> - 2017-07-26 23:20 +0200

#1697480 — nowait aio return value

FromJason Baron <jbaron@akamai.com>
Date2017-07-26 20:50 +0200
Subjectnowait aio return value
Message-ID<u7zxD-3Wx-11@gated-at.bofh.it>
Hi,

In testing nowait aio on ext4, I found that when appending to a file
the return value is EAGAIN/EWOULDBLOCK, because as mentioned in the 
commit this will potentially trigger an allocation. However, the EAGAIN, 
seems somewhat misleading to me, in that if I continuously try the 
write, it will never succeed.

The relevant commit is:
728fbc0 ext4: nowait aio support

As you can see there, failure to get the inode lock is treated as
EAGAIN, which seems more appropriate to me, as its very likely
to succeed on subsequent calls.

Perhaps, it could be switched to -EINVAL, or something else?

Thanks,

-Jason

[toc] | [next] | [standalone]


#1697565

FromGoldwyn Rodrigues <rgoldwyn@suse.de>
Date2017-07-26 23:20 +0200
Message-ID<u7BSN-5zh-9@gated-at.bofh.it>
In reply to#1697480
Hi Jason,

On 07/26/2017 01:45 PM, Jason Baron wrote:
> Hi,
> 
> In testing nowait aio on ext4, I found that when appending to a file
> the return value is EAGAIN/EWOULDBLOCK, because as mentioned in the
> commit this will potentially trigger an allocation. However, the EAGAIN,
> seems somewhat misleading to me, in that if I continuously try the
> write, it will never succeed.
> 
> The relevant commit is:
> 728fbc0 ext4: nowait aio support
> 
> As you can see there, failure to get the inode lock is treated as
> EAGAIN, which seems more appropriate to me, as its very likely
> to succeed on subsequent calls.
> 
> Perhaps, it could be switched to -EINVAL, or something else?
> 

Thanks for testing this.

I would suggest read it as -EWOULDBLOCK. The idea is to pass on
IOCB_NOWAIT when we don't want the I/O process to wait, and if it does
return -EWOULDBLOCK. If it returns EWOULDBLOCK in case of allocation,
you may want to allocate your file space before performing the I/O.

I would return EINVAL in case the parameters passed are incorrect.

-- 
Goldwyn

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web