Re: [PATCH 1/2] btrfs: tree-checker: Make write time tree checker verify the content of leaves

Qu Wenruo
2019-04-03T14:20:18Z

On 2019/4/3 下午10:12, Nikolay Borisov wrote:
>
>
> On 3.04.19 г. 14:59 ч., Qu Wenruo wrote:
>> Commit "btrfs: Do mandatory tree block check before submitting bio" is
>> designed to check leaves contents, just as read time check.
>>
>> However due to the confusing parameter list, "false" is passed to where
>> it is supposed to be "true".
>>
>> Signed-off-by: Qu Wenruo <wqu@suse.com>
>
> The subject of the patch could be a bit more precise, by passing true
> you are doing further validation of the body of individual items in the
> leaves. Alternatively you are sanity checking the keys and the
> boundaries of item body. So how about:
>
> "Perform item body validation during write"

That's much better, I'd take that tile if I need to resend.

Thanks,
Qu

>
>
> Reviewed-by: Nikolay Borisov <nborisov@suse.com>
>
>> ---
>> fs/btrfs/tree-checker.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
>> index 4318e3e67443..204fe53c90aa 100644
>> --- a/fs/btrfs/tree-checker.c
>> +++ b/fs/btrfs/tree-checker.c
>> @@ -999,7 +999,7 @@ int btrfs_check_leaf_relaxed(struct btrfs_fs_info *fs_info,
>> int btrfs_check_leaf_write(struct btrfs_fs_info *fs_info,
>> struct extent_buffer *leaf)
>> {
>> - return check_leaf(leaf, false, false);
>> + return check_leaf(leaf, true, false);
>> }
>>
>> int btrfs_check_node(struct btrfs_fs_info *fs_info, struct extent_buffer *node)
>>