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 <wqu@suse.com>
Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
This commit is contained in:
Su Yue 2019-02-27 14:05:45 +08:00 committed by Qu Wenruo
parent a170ef86ff
commit 0617bde3bc
1 changed files with 8 additions and 0 deletions

View File

@ -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;