From 0617bde3bc15fc545cd5e98e52845b41b4c6d844 Mon Sep 17 00:00:00 2001 From: Su Yue Date: Wed, 27 Feb 2019 14:05:45 +0800 Subject: [PATCH] btrfs-progs: lowmem: delete unaligned bytes extent data under repair If found a extent data item has unaligned part, lowmem repair just deletes it. Reviewed-by: Qu Wenruo Signed-off-by: Su Yue Signed-off-by: Qu Wenruo --- check/mode-lowmem.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c index 7bd18902..bedf1862 100644 --- a/check/mode-lowmem.c +++ b/check/mode-lowmem.c @@ -3037,6 +3037,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. * @@ -3088,6 +3089,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;