[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5d327bed-b532-ad3b-a211-52ad0a3e276a@kernel.org>
Date: Thu, 25 May 2023 08:13:28 +0900
From: Damien Le Moal <dlemoal@...nel.org>
To: David Howells <dhowells@...hat.com>
Cc: Jens Axboe <axboe@...nel.dk>, Al Viro <viro@...iv.linux.org.uk>,
Christoph Hellwig <hch@...radead.org>,
Matthew Wilcox <willy@...radead.org>, Jan Kara <jack@...e.cz>,
Jeff Layton <jlayton@...nel.org>,
David Hildenbrand <david@...hat.com>,
Jason Gunthorpe <jgg@...dia.com>,
Logan Gunthorpe <logang@...tatee.com>,
Hillf Danton <hdanton@...a.com>,
Christian Brauner <brauner@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-fsdevel@...r.kernel.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Christoph Hellwig <hch@....de>,
"Darrick J . Wong" <djwong@...nel.org>, linux-xfs@...r.kernel.org
Subject: Re: [PATCH v22 25/31] zonefs: Provide a splice-read wrapper
On 5/24/23 05:43, David Howells wrote:
> Damien Le Moal <dlemoal@...nel.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
Powered by blists - more mailing lists