public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Goldwyn Rodrigues <rgoldwyn@suse.de>
Cc: Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	David Sterba <dsterba@suse.cz>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: don't fallback to buffered read if we don't need to
Date: Fri, 23 Oct 2020 18:05:19 +0200	[thread overview]
Message-ID: <20201023160519.GI6756@twin.jikos.cz> (raw)
In-Reply-To: <20201022150033.uqvg2wqtjo5fnx5b@fiona>

On Thu, Oct 22, 2020 at 10:00:33AM -0500, Goldwyn Rodrigues wrote:
> > diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
> > index 6f5ecba74f54..1c97e559aefb 100644
> > --- a/fs/btrfs/file.c
> > +++ b/fs/btrfs/file.c
> > @@ -3612,7 +3612,8 @@ static ssize_t btrfs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
> >  		inode_lock_shared(inode);
> >  		ret = btrfs_direct_IO(iocb, to);
> >  		inode_unlock_shared(inode);
> > -		if (ret < 0)
> > +		if (ret < 0 || !iov_iter_count(to) ||
> > +		    iocb->ki_pos >= i_size_read(file_inode(iocb->ki_filp)))
> >  			return ret;

JFYI, this conflicts with patch "btrfs: split btrfs_direct_IO to read
and write" from your dsync/dio series it will need to be refreshed.

      reply	other threads:[~2020-10-23 16:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22 14:05 [PATCH v2] btrfs: don't fallback to buffered read if we don't need to Johannes Thumshirn
2020-10-22 15:00 ` Goldwyn Rodrigues
2020-10-23 16:05   ` David Sterba [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=20201023160519.GI6756@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=rgoldwyn@suse.de \
    /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