From: Qu Wenruo
Introuduce new local structures, scrub_full_stripe and scrub_stripe, for
incoming offline RAID56 scrub support.
For pure stripe/mirror based profiles, like raid0/1/10/dup/single, we
will follow the original bytenr and mirror number based iteration, so
they don't need any extra st
From: Qu Wenruo
Introduce new function, check/recover_data_mirror(), to check and recover
mirror based data blocks.
Unlike tree block, data blocks must be recovered sector by sector, so we
introduced corrupted_bitmap for check and recover.
Signed-off-by: Qu Wenruo
Signed-off-by: Su Yue
Signed
From: Qu Wenruo
Introduce new function, scrub_one_block_group(), to scrub a block group.
For Single/DUP/RAID0/RAID1/RAID10, we use old mirror number based
map_block, and check extent by extent.
For parity based profile (RAID5/6), we use new map_block_v2() and check
full stripe by full stripe.
From: Qu Wenruo
Now, btrfs-progs has a kernel scrub equivalent.
A new option, --offline is added to "btrfs scrub start".
If --offline is given, btrfs scrub will just act like kernel scrub, to
check every copy of extent and do a report on corrupted data and if it's
recoverable.
The advantage com
From: Qu Wenruo
Introduce function, recover_from_parities(), to recover data stripes.
It just wraps raid56_recov() with extra check functions to
scrub_full_stripe structure.
Signed-off-by: Qu Wenruo
---
scrub.c | 51 +++
1 file changed, 51 inser
From: Qu Wenruo
Introduce a internal helper, write_full_stripe() to calculate P/Q and
write the whole full stripe.
This is useful to recover RAID56 stripes.
Signed-off-by: Qu Wenruo
---
scrub.c | 44
1 file changed, 44 insertions(+)
diff --git a/s
For any one who wants to try it, it can be get from my repo:
https://github.com/gujx2017/btrfs-progs/tree/offline_scrub
In this v6, fix for make error reported by Marco Lorenzo Crociani.
Several reports on kernel scrub screwing up good data stripes are in ML
for sometime.
And since kernel scrub
From: Qu Wenruo
Introduce new function, scrub_one_data_stripe(), to check all data and
tree blocks inside the data stripe.
This function will not try to recovery any error, but only check if any
data/tree blocks has mismatch csum.
If data missing csum, which is completely valid for case like no
From: Qu Wenruo
Introduce new function, verify_parities(), to check whether parities match
with full stripe, whose data stripes match with their csum.
Caller should fill the scrub_full_stripe structure properly before
calling this function.
Signed-off-by: Qu Wenruo
Signed-off-by: Gu Jinxiang
From: Qu Wenruo
Introduce a new function, btrfs_check_extent_exists(), to check if there
is any extent in the range specified by user.
The parameter can be a large range, and if any extent exists in the
range, it will return >0 (in fact it will return 1).
Or return 0 if no extent is found.
Sign
From: Qu Wenruo
For READ, caller normally hopes to get what they request, other than
full stripe map.
In this case, we should remove unrelated stripe map, just like the
following case:
32K 96K
|<-request range->|
0 64k 1
From: Qu Wenruo
Introduce a new function, scrub_one_full_stripe(), to check a full
stripe.
It handles the full stripe scrub in the following steps:
0) Check if we need to check full stripe
If full stripe contains no extent, why waste our CPU and IO?
1) Read out full stripe
Then we know ho
From: Qu Wenruo
Introduce a new function, scrub_one_extent(), as a wrapper to check one
mirror-based extent.
It will accept a btrfs_path parameter @path, which must point to a
META/EXTENT_ITEM.
And @start, @len, which must be a subset of META/EXTENT_ITEM.
Signed-off-by: Qu Wenruo
Signed-off-by
From: Qu Wenruo
Introduce a new function, __btrfs_map_block_v2().
Unlike old btrfs_map_block(), which needs different parameter to handle
different RAID profile, this new function uses unified btrfs_map_block
structure to handle all RAID profile in a more meaningful method:
Return physical addr
From: Qu Wenruo
Introduce new functions, check/recover_tree_mirror(), to check and
recover mirror-based tree blocks (Single/DUP/RAID0/1/10).
check_tree_mirror() can also be used on in-memory tree blocks using @data
parameter.
This is very handy for RAID5/6 case, either checking the data stripe
t
From: Qu Wenruo
Introduce a new function: btrfs_read_data_csums(), to read out csums
for sectors in range.
This is quite useful for read out data csum so we don't need to do it
using open code.
Signed-off-by: Qu Wenruo
Signed-off-by: Su Yue
Signed-off-by: Gu Jinxiang
---
Makefile | 2
Different C compilers have different default language standard.
This sometimes causes problem on different system.
For distribution like CentOS/RHEL7, its gcc is still 4.8 and will report
error for c90 style declaration, while most developers are using newer
gcc which will just ignore it.
This mak
On 2017年07月20日 00:45, Marco Lorenzo Crociani wrote:
On 18/07/2017 08:33, Gu Jinxiang wrote:
For any one who wants to try it, it can be get from my repo:
https://github.com/gujx2017/btrfs-progs/tree/offline_scrub
Hi,
I'm getting this error during make:
[CC] csum.o
csum.c: In functi
If we have a block group that is all of the following:
1) uncached in memory
2) is read-only
3) has a disk cache state that indicates we need to recreate the cache
AND the file system has enough free space fragmentation such that the
request for an extent of a given size can't be honored;
AND hav
On 07/18/2017 11:01 PM, David Sterba wrote:
On Tue, Jul 18, 2017 at 05:37:47PM +0800, Anand Jain wrote:
Its better to have the policy enforcement going through a function,
so that we have better control and visibility of the decision logic.
Signed-off-by: Anand Jain
---
fs/btrfs/inode.c |
On Wed, Jul 19, 2017 at 04:13:07PM +0300, Dan Carpenter wrote:
> Hello David Sterba,
>
> This is a semi-automatic email about new static checker warnings.
>
> The patch c042dd070450: "btrfs: get fs_info from eb in
> btrfs_print_leaf, remove argument" from Jun 29, 2017, leads to the
> following Sm
Correctly account for IO when waiting for a submitted bio in scrub. This
only for the accounting purposes and should not change other behaviour.
Signed-off-by: David Sterba
---
fs/btrfs/scrub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.
Correctly account for IO when waiting for a submitted DIO read, the case
when we're retrying. This only for the accounting purposes and should
not change other behaviour.
Signed-off-by: David Sterba
---
fs/btrfs/inode.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/
On 18/07/2017 08:33, Gu Jinxiang wrote:
For any one who wants to try it, it can be get from my repo:
https://github.com/gujx2017/btrfs-progs/tree/offline_scrub
Hi,
I'm getting this error during make:
[CC] csum.o
csum.c: In function ‘btrfs_read_data_csums’:
csum.c:119:3: error: ‘for’ l
On Tue, Jul 18, 2017 at 08:34:02PM +0100, fdman...@kernel.org wrote:
> From: Filipe Manana
>
> We were passing an incorrect slot number to the function that validates
> directory items when we are replaying xattr deletes from a log tree. The
> correct slot is stored at variable 'i' and not at 'pa
From: Filipe Manana
We were passing an incorrect slot number to the function that validates
directory items when we are replaying xattr deletes from a log tree. The
correct slot is stored at variable 'i' and not at 'path->slots[0]', so
the call to the validation function was only correct for the
Hello David Sterba,
This is a semi-automatic email about new static checker warnings.
The patch c042dd070450: "btrfs: get fs_info from eb in
btrfs_print_leaf, remove argument" from Jun 29, 2017, leads to the
following Smatch complaint:
fs/btrfs/print-tree.c:181 btrfs_print_leaf()
warn: v
clear_super - usage was removed in commit
cea67ab92d3d ("btrfs: clean the old superblocks before freeing the device") but
that change forgot to remove the actual variable.
max_key - commit 6174d3cb43aa ("Btrfs: remove unused max_key arg from
btrfs_search_forward") removed the max_key parameter but
This also adjusts the respective callers in other files. Those were found with
-Wunused-parameter.
btrfs_full_stripe_len's mapping_tree - introduced by
53b381b3abeb ("Btrfs: RAID5 and RAID6") but it was never really used even in
that commit
btrfs_is_parity_mirror's mirror_num - same as above
chu
29 matches
Mail list logo