From: Theodore Ts'o <tytso@mit.edu>
To: Sean Fu <fxinrong@gmail.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ext4: Remove repeated test in ext4_file_read_iter.
Date: Wed, 10 Jan 2018 15:02:55 -0500 [thread overview]
Message-ID: <20180110200255.GA6499@thunk.org> (raw)
In-Reply-To: <20180110140149.GA5174@linux-zmni.DHCP>
On Wed, Jan 10, 2018 at 10:01:49PM +0800, Sean Fu wrote:
>
> Correct, IOCB_NOWAIT read with zero count can return -EAGAIN, But I
> think that it is reasonable. while it got lock, zero would be returned
> in this case.
Returning -EAGAIN and 0 are not the same thing. Specifically
returning 0 means "end of file". Hence, it is NOT reasonable.
See the man page for read(2) or the relevant Single Unix Specification
standard:
RETURN VALUE
On success, the number of bytes read is returned (zero indicates
end of file)....
Changing the behavior of the system in which will break userspace is
never acceptable, and even more so given that this is just a "cleanup
patch".
- Ted
next prev parent reply other threads:[~2018-01-10 20:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-27 8:19 [PATCH] ext4: Remove repeated test in ext4_file_read_iter Sean Fu
2018-01-03 2:08 ` Al Viro
2018-01-10 14:01 ` Sean Fu
2018-01-10 20:02 ` Theodore Ts'o [this message]
2018-01-16 8:10 ` Sean Fu
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=20180110200255.GA6499@thunk.org \
--to=tytso@mit.edu \
--cc=adilger.kernel@dilger.ca \
--cc=fxinrong@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/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).