From: Goldwyn Rodrigues <rgoldwyn@suse.de>
To: Jason Baron <jbaron@akamai.com>
Cc: jack@suse.cz, axboe@kernel.dk, linux-ext4@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: nowait aio return value
Date: Wed, 26 Jul 2017 16:19:34 -0500 [thread overview]
Message-ID: <08dcc9f7-2460-c262-3194-062a25052bc3@suse.de> (raw)
In-Reply-To: <04be5a78-3428-c09e-bc63-5061fa568ea5@akamai.com>
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
prev parent reply other threads:[~2017-07-26 21:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-26 18:45 Jason Baron
2017-07-26 21:19 ` Goldwyn Rodrigues [this message]
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=08dcc9f7-2460-c262-3194-062a25052bc3@suse.de \
--to=rgoldwyn@suse.de \
--cc=axboe@kernel.dk \
--cc=jack@suse.cz \
--cc=jbaron@akamai.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®