public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: David Howells <dhowells@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>, Al Viro <viro@zeniv.linux.org.uk>,
	Christoph Hellwig <hch@infradead.org>,
	Matthew Wilcox <willy@infradead.org>, Jan Kara <jack@suse.cz>,
	Jeff Layton <jlayton@kernel.org>,
	David Hildenbrand <david@redhat.com>,
	Jason Gunthorpe <jgg@nvidia.com>,
	Logan Gunthorpe <logang@deltatee.com>,
	Hillf Danton <hdanton@sina.com>,
	Christian Brauner <brauner@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Christoph Hellwig <hch@lst.de>,
	"Darrick J . Wong" <djwong@kernel.org>,
	linux-xfs@vger.kernel.org
Subject: Re: [PATCH v22 25/31] zonefs: Provide a splice-read wrapper
Date: Thu, 25 May 2023 08:13:28 +0900	[thread overview]
Message-ID: <5d327bed-b532-ad3b-a211-52ad0a3e276a@kernel.org> (raw)
In-Reply-To: <3071148.1684874594@warthog.procyon.org.uk>

On 5/24/23 05:43, David Howells wrote:
> Damien Le Moal <dlemoal@kernel.org> wrote:
> 
>>> +	if (len > 0) {
>>> +		ret = filemap_splice_read(in, ppos, pipe, len, flags);
>>> +		if (ret == -EIO)
>>
>> Is -EIO the only error that filemap_splice_read() may return ? There are other
>> IO error codes that we could get from the block layer, e.g. -ETIMEDOUT etc. So
>> "if (ret < 0)" may be better here ?
> 
> It can return -ENOMEM, -EINTR and -EAGAIN at least, none of which really count
> as I/O errors.  I based the splice function on what zonefs_file_read_iter()
> does:
> 
> 	} else {
> 		ret = generic_file_read_iter(iocb, to);
> 		if (ret == -EIO)
> 			zonefs_io_error(inode, false);
> 	}

Fair point. But checking again zonefs_io_error(), it will do nothing is nothing
bad is detected for the zone that was used for the failed IO. So calling
zonefs_io_error() for all error codes is actually fine, and likely much safer. I
will change that in zonefs_file_read_iter(). Please use "if (ret < 0)" in your
patch.

-- 
Damien Le Moal
Western Digital Research


      reply	other threads:[~2023-05-24 23:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230522135018.2742245-1-dhowells@redhat.com>
2023-05-22 13:49 ` [PATCH v22 08/31] splice: Make splice from a DAX file use copy_splice_read() David Howells
2023-05-22 13:50 ` [PATCH v22 24/31] xfs: Provide a splice-read wrapper David Howells
2023-05-22 13:50 ` [PATCH v22 25/31] zonefs: " David Howells
2023-05-23  2:48   ` Damien Le Moal
2023-05-23 20:43     ` David Howells
2023-05-24 23:13       ` Damien Le Moal [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=5d327bed-b532-ad3b-a211-52ad0a3e276a@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=david@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=djwong@kernel.org \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=hdanton@sina.com \
    --cc=jack@suse.cz \
    --cc=jgg@nvidia.com \
    --cc=jlayton@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=logang@deltatee.com \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.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