linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Sean Fu <fxinrong@gmail.com>
Cc: tytso@mit.edu, 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, 3 Jan 2018 02:08:05 +0000	[thread overview]
Message-ID: <20180103020805.GB21978@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1514362798-5850-1-git-send-email-fxinrong@gmail.com>

On Wed, Dec 27, 2017 at 04:19:58PM +0800, Sean Fu wrote:
> generic_file_read_iter has done the count test.
> So ext4_file_read_iter don't need to test the count repeatedly.

Huh?  You do realize that generic_file_read_iter() is not the
only variant possible there, right?

static ssize_t ext4_dax_read_iter(struct kiocb *iocb, struct iov_iter *to)
{
        struct inode *inode = file_inode(iocb->ki_filp);
        ssize_t ret;

        if (!inode_trylock_shared(inode)) {
                if (iocb->ki_flags & IOCB_NOWAIT)
                        return -EAGAIN;
                inode_lock_shared(inode);
        }

... and now IOCB_NOWAIT read with zero count can fail with -EAGAIN.

  reply	other threads:[~2018-01-03  2:08 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 [this message]
2018-01-10 14:01   ` Sean Fu
2018-01-10 20:02     ` Theodore Ts'o
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=20180103020805.GB21978@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=adilger.kernel@dilger.ca \
    --cc=fxinrong@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).