Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 877550 Details for
Bug 1051985
btrfs-progs: btrfs scrub returns non-zero but reports no errors
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Bug fix for your problem
0001-Btrfs-scrub-raid56-stripes-in-the-right-way.patch (text/plain), 2.76 KB, created by
Wang Shilong
on 2014-03-22 07:19:37 UTC
(
hide
)
Description:
Bug fix for your problem
Filename:
MIME Type:
Creator:
Wang Shilong
Created:
2014-03-22 07:19:37 UTC
Size:
2.76 KB
patch
obsolete
>From 24e0950c8128bbb78ab131fc7ce7ab3a226ac6ae Mon Sep 17 00:00:00 2001 >From: Wang Shilong <wangsl.fnst@cn.fujitsu.com> >Date: Sat, 22 Mar 2014 14:52:44 +0800 >Subject: [PATCH] Btrfs: scrub raid56 stripes in the right way > >Steps to reproduce: > # mkfs.btrfs -f /dev/sda[8-11] -m raid5 -d raid5 > # mount /dev/sda8 /mnt > # btrfs scrub start -BR /mnt > # echo $? <--unverified errors make return value be 3 > >This is because we don't setup right mapping between physical >and logical address for raid56, which makes checksum mismatch. >But we will find everthing is fine later when rechecking using >btrfs_map_block(). > >This patch fixed the problem by settuping right mapping and >we only verify data stripes' checksums. > >Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> >--- > fs/btrfs/scrub.c | 33 +++++++++++++++++++++++++-------- > 1 file changed, 25 insertions(+), 8 deletions(-) > >diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c >index db21a13..4182b44a 100644 >--- a/fs/btrfs/scrub.c >+++ b/fs/btrfs/scrub.c >@@ -2267,16 +2267,12 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx, > u64 extent_logical; > u64 extent_physical; > u64 extent_len; >+ u64 stripe_nr; >+ u64 tmp; >+ int stripe_index; > struct btrfs_device *extent_dev; > int extent_mirror_num; >- int stop_loop; >- >- if (map->type & (BTRFS_BLOCK_GROUP_RAID5 | >- BTRFS_BLOCK_GROUP_RAID6)) { >- if (num >= nr_data_stripes(map)) { >- return 0; >- } >- } >+ int stop_loop = 0; > > nstripes = length; > offset = 0; >@@ -2296,6 +2292,14 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx, > } else if (map->type & BTRFS_BLOCK_GROUP_DUP) { > increment = map->stripe_len; > mirror_num = num % map->num_stripes + 1; >+ } else if (map->type & (BTRFS_BLOCK_GROUP_RAID5 | >+ BTRFS_BLOCK_GROUP_RAID6)) { >+ if (num < nr_data_stripes(map)) >+ offset = num * map->stripe_len; >+ else >+ offset = (nr_data_stripes(map) - 1) * map->stripe_len; >+ increment = map->stripe_len * nr_data_stripes(map); >+ mirror_num = 1; > } else { > increment = map->stripe_len; > mirror_num = 1; >@@ -2361,6 +2365,18 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx, > logic_end = logical + increment * nstripes; > ret = 0; > while (logical < logic_end) { >+ /* skip parity */ >+ if (map->type & (BTRFS_BLOCK_GROUP_RAID5 | >+ BTRFS_BLOCK_GROUP_RAID6)) { >+ stripe_nr = logical - base; >+ do_div(stripe_nr, map->stripe_len); >+ >+ stripe_index = do_div(stripe_nr, nr_data_stripes(map)); >+ tmp = stripe_nr + stripe_index; >+ stripe_index = do_div(tmp, map->num_stripes); >+ if (stripe_index != num) >+ goto skip; >+ } > /* > * canceled? > */ >@@ -2521,6 +2537,7 @@ next: > path->slots[0]++; > } > btrfs_release_path(path); >+skip: > logical += increment; > physical += map->stripe_len; > spin_lock(&sctx->stat_lock); >-- >1.9.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1051985
: 877550