Re: [PATCH] btrfs: factor our read/write stage off csum_tree_block() into its callers

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

 



On 19/02/2019 10:31, Nikolay Borisov wrote:
>>  
>> -	return csum_tree_block(fs_info, eb, 0);
>> +	if (WARN_ON(csum_tree_block(eb, result)))
>> +		return -EUCLEAN;
> 
> I meant to discuss this with you yesterday but  the WARN_ON here could
> trigger only if map_private_extent_buffer fails. And that could be only
> due to two things:
> 
> 1. If we want to map more than the buffer's length
> 
> 2. If the item spans two pages.
> 
> Initially I wondered whether WARN_ON is really appropriate but the more
> I think about it the more I'm inclined to say yes. However, I wonder if
> EUCLEAN is the correct error code and shouldn't it be, perhaps, -EINVAL
>  (as returned from map_private_extent_buffer), that fits both with the
> return code in case of invalid mapping length as well as item spanning
> multiple pages. What are your thoughts?
> 

I choose -EUCLEAN as it is used in csum_dirty_buffer() before, but yes
agreed, returning the error from csum_tree_block() would be better here.

-- 
Johannes Thumshirn                            SUSE Labs Filesystems
jthumshirn@xxxxxxx                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux