From: Su Yue <[email protected]> If found a extent data item has unaligned part, lowmem repair just deletes it.
Signed-off-by: Su Yue <[email protected]> Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Qu Wenruo <[email protected]> --- check/mode-lowmem.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c index c6255334fc07..3cb3d4634e29 100644 --- a/check/mode-lowmem.c +++ b/check/mode-lowmem.c @@ -3036,6 +3036,7 @@ out: } /* + * If @err contains BYTES_UNALIGNED then delete the extent data item. * If @err contains BACKREF_MISSING then add extent of the * file_extent_data_item. * @@ -3087,6 +3088,13 @@ static int repair_extent_data_item(struct btrfs_root *root, else parent = 0; + if (err & BYTES_UNALIGNED) { + ret = delete_item(root, pathp); + if (!ret) + err = 0; + goto out; + } + /* now repair only adds backref */ if ((err & BACKREF_MISSING) == 0) return err; -- 2.20.0
