Re: [PATCH 0/6] btrfs-progs: Fixes for github issues

Qu Wenruo
2020-01-07T01:46:19Z

[-- Attachment #1.1: Type: text/plain, Size: 2798 bytes --]

On 2020/1/6 下午11:45, David Sterba wrote:
> On Sat, Jan 04, 2020 at 09:26:25AM +0800, Qu Wenruo wrote:
>>
>>
>> On 2020/1/3 下午11:27, David Sterba wrote:
>>> On Fri, Jan 03, 2020 at 08:43:01AM +0800, Qu Wenruo wrote:
>>>>
>>>>
>>>> On 2020/1/3 上午1:10, David Sterba wrote:
>>>>> On Wed, Dec 18, 2019 at 09:19:36AM +0800, Qu Wenruo wrote:
>>>>>> There are a new batch of fuzzed images for btrfs-progs. They are all
>>>>>> reported by Ruud van Asseldonk from github.
>>>>>>
>>>>>> Patch 1 will make QA life easier by remove the extra 300s wait time.
>>>>>> Patch 2~5 are all the meat for the fuzzed images.
>>>>>>
>>>>>> Just a kind reminder, mkfs/020 test will fail due to tons of problems:
>>>>>> - Undefined $csum variable
>>>>>> - Undefined $dev1 variable
>>>>>
>>>>> These are fixed in devel now.
>>>>>
>>>>>> - Bad kernel probe for support csum
>>>>>> E.g. if Blake2 not compiled, it still shows up in supported csum algo,
>>>>>> but will fail to mount.
>>>>>
>>>>> The list of supported is from the point of view of the filesystem.
>>>>> Providing the module is up to the user.
>>>>
>>>> IIRC, doing such probe at btrfs module load time would be more user
>>>> friendly though.
>>>
>>> I don't understand how you think this could be improved. The list of
>>> algorithms is provided by the filesystem, the implementations are
>>> provided by the crypto subsystem (either compiled in or as modules). Two
>>> different things.
>>>
>>> So you mean that at btrfs module load time, all hash algorithms are
>>> probed?
>>
>> Yes, that's why I mean.
>>
>>> What if some of them gets unloaded, or loaded later (so modprobe
>>> won't see it at btrfs load time). This would require keeping the state
>>> up to date and this is out of scope what filesystem should do.
>>>
>> Isn't there any mechanism to load the module when necessary?
>
> Yes, that's what we rely on, once a filesystem is mounted it will
> instantiate the crypto shash, that in turn will trigger module load if
> necessary.
>
> Probing all algorithms would load more modules than needed, for the only
> reason to store/print list of what succeeded at that time. Whatever
> happens to the system later will not be reflected here. And that's why I
> don't want to do that, so we list checksums understood by btrfs module.
>
But we don't have requirement for all supported csum algo.

So it's completely possible to have a case where we don't have csum
support for BLAKE2.
Furthermore, there is no way to determine whether we support it at runtime.

Now we depend on distro to include all needed algorithms, although most
distro would include all these algos, but this still look a little
strange to me.

Any better solution for this?

Thanks,
Qu

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 520 bytes --]