Re: [PATCH v2 0/6] btrfs: Enhanced validation check for fuzzed images

2018-08-02 Thread Qu Wenruo


On 2018年08月03日 00:40, David Sterba wrote:
> On Wed, Aug 01, 2018 at 10:37:15AM +0800, Qu Wenruo wrote:
>> The branch can be fetched from the following git repo:
>> https://github.com/adam900710/linux/tree/tree_checker_enhance
>>
>> It's based on v4.18-rc1, with 3 patches already merged into misc-next.
>>
>> This patchset introduced the following enhanced validation check:
>> 1) chunk/block group/dev extent cross check
>>Unlike extent tree, such cross check can be implemented pretty easy
>>with minimal mount time impact.
>>Now the kernel could do chunk/bg/dev extent check as good as btrfs
>>check.
>>
>> 2) Locking test to avoid possible deadlock due to extent tree corruption
>>Unfortunately, for extent tree we can't do really much cross check.
>>Instead we use the selftest from btrfs_tree_lock() to detect and
>>avoid deadlock caused by corrupted extent tree.
> 
> Great, thanks.
> 
>> The 3rd patch "btrfs: Remove unused function 
>> btrfs_account_dev_extents_size()"
>> has also been merged into misc-next.
>>
>> changelog:
>> v2:
>>   Added reviewed-by tags from Gu and Nikolay.
>>   Address comment from David for the 4th patch
>>   Address comment from Gu for the 2nd patch.
> 
> Please rather write what did you fix and not who suggested that. There
> are many patches and iterations and I don't remember everything.

Sorry for that.

And for this patchset, the changelog should be:
  Added reviewed-by tags.
  Fixed unused variable and Link: tag.
  Moved checks to find_first_block_group() to reduce duplication.

> 
>>
>> Qu Wenruo (6):
>>   btrfs: Check each block group has corresponding chunk at mount time
>>   btrfs: Verify every chunk has corresponding block group at mount time
>>   btrfs: Remove unused function btrfs_account_dev_extents_size()
>>   btrfs: Introduce mount time chunk <-> dev extent mapping check
>>   btrfs: Exit gracefully when failed to add chunk map
> 
> The above merged, with some adjustments of changelogs or the error
> messages.
> 
>>   btrfs: locking: Allow btrfs_tree_lock() to return error to avoid
>> deadlock
> 
> I need to read and understand the explanation you posted, so this patch
> is not in misc-next, I'll add it to for-next after I'll do the first
> pass review.

Feel free to ask if there is anything unclear.

Thanks,
Qu

> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 



signature.asc
Description: OpenPGP digital signature


Re: [PATCH v2 0/6] btrfs: Enhanced validation check for fuzzed images

2018-08-02 Thread David Sterba
On Wed, Aug 01, 2018 at 10:37:15AM +0800, Qu Wenruo wrote:
> The branch can be fetched from the following git repo:
> https://github.com/adam900710/linux/tree/tree_checker_enhance
> 
> It's based on v4.18-rc1, with 3 patches already merged into misc-next.
> 
> This patchset introduced the following enhanced validation check:
> 1) chunk/block group/dev extent cross check
>Unlike extent tree, such cross check can be implemented pretty easy
>with minimal mount time impact.
>Now the kernel could do chunk/bg/dev extent check as good as btrfs
>check.
> 
> 2) Locking test to avoid possible deadlock due to extent tree corruption
>Unfortunately, for extent tree we can't do really much cross check.
>Instead we use the selftest from btrfs_tree_lock() to detect and
>avoid deadlock caused by corrupted extent tree.

Great, thanks.

> The 3rd patch "btrfs: Remove unused function btrfs_account_dev_extents_size()"
> has also been merged into misc-next.
> 
> changelog:
> v2:
>   Added reviewed-by tags from Gu and Nikolay.
>   Address comment from David for the 4th patch
>   Address comment from Gu for the 2nd patch.

Please rather write what did you fix and not who suggested that. There
are many patches and iterations and I don't remember everything.

> 
> Qu Wenruo (6):
>   btrfs: Check each block group has corresponding chunk at mount time
>   btrfs: Verify every chunk has corresponding block group at mount time
>   btrfs: Remove unused function btrfs_account_dev_extents_size()
>   btrfs: Introduce mount time chunk <-> dev extent mapping check
>   btrfs: Exit gracefully when failed to add chunk map

The above merged, with some adjustments of changelogs or the error
messages.

>   btrfs: locking: Allow btrfs_tree_lock() to return error to avoid
> deadlock

I need to read and understand the explanation you posted, so this patch
is not in misc-next, I'll add it to for-next after I'll do the first
pass review.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 0/6] btrfs: Enhanced validation check for fuzzed images

2018-07-31 Thread Qu Wenruo
The branch can be fetched from the following git repo:
https://github.com/adam900710/linux/tree/tree_checker_enhance

It's based on v4.18-rc1, with 3 patches already merged into misc-next.

This patchset introduced the following enhanced validation check:
1) chunk/block group/dev extent cross check
   Unlike extent tree, such cross check can be implemented pretty easy
   with minimal mount time impact.
   Now the kernel could do chunk/bg/dev extent check as good as btrfs
   check.

2) Locking test to avoid possible deadlock due to extent tree corruption
   Unfortunately, for extent tree we can't do really much cross check.
   Instead we use the selftest from btrfs_tree_lock() to detect and
   avoid deadlock caused by corrupted extent tree.

The 3rd patch "btrfs: Remove unused function btrfs_account_dev_extents_size()"
has also been merged into misc-next.

changelog:
v2:
  Added reviewed-by tags from Gu and Nikolay.
  Address comment from David for the 4th patch
  Address comment from Gu for the 2nd patch.

Qu Wenruo (6):
  btrfs: Check each block group has corresponding chunk at mount time
  btrfs: Verify every chunk has corresponding block group at mount time
  btrfs: Remove unused function btrfs_account_dev_extents_size()
  btrfs: Introduce mount time chunk <-> dev extent mapping check
  btrfs: Exit gracefully when failed to add chunk map
  btrfs: locking: Allow btrfs_tree_lock() to return error to avoid
deadlock

 fs/btrfs/ctree.c   |  57 ++--
 fs/btrfs/disk-io.c |   7 +
 fs/btrfs/extent-tree.c | 114 +--
 fs/btrfs/extent_io.c   |   8 +-
 fs/btrfs/free-space-tree.c |   4 +-
 fs/btrfs/locking.c |  13 +-
 fs/btrfs/locking.h |   2 +-
 fs/btrfs/qgroup.c  |   4 +-
 fs/btrfs/relocation.c  |  13 +-
 fs/btrfs/tree-log.c|  14 +-
 fs/btrfs/volumes.c | 276 +
 fs/btrfs/volumes.h |   4 +-
 12 files changed, 397 insertions(+), 119 deletions(-)

-- 
2.18.0

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html