Re: [PATCH v22 25/31] zonefs: Provide a splice-read wrapper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/24/23 05:43, David Howells wrote:
> Damien Le Moal <dlemoal@xxxxxxxxxx> 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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux