On 2019/8/28 下午10:06, Anand Jain wrote:
> So when searching for BTRFS_DEV_ITEMS_OBJECTID, it hits, albeit it is
> defined same as BTRFS_ROOT_TREE_OBJECTID.
>
> Signed-off-by: Anand Jain <anand.jain@xxxxxxxxxx>
Reviewed-by: Qu Wenruo <wqu@xxxxxxxx>
> ---
> v1->v2: Improve comment.
>
> print-tree.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/print-tree.c b/print-tree.c
> index b31e515f8989..b1c59d776547 100644
> --- a/print-tree.c
> +++ b/print-tree.c
> @@ -705,6 +705,11 @@ void print_objectid(FILE *stream, u64 objectid, u8 type)
>
> switch (objectid) {
> case BTRFS_ROOT_TREE_OBJECTID:
> + /*
> + * BTRFS_ROOT_TREE_OBJECTID and BTRFS_DEV_ITEMS_OBJECTID are
> + * defined with the same value of 1ULL, distinguish them by
> + * checking the type.
> + */
Oh, some bad design from the very beginning of btrfs.
Any other duplicated objectid?
Thanks,
Qu
> if (type == BTRFS_DEV_ITEM_KEY)
> fprintf(stream, "DEV_ITEMS");
> else
>
Attachment:
signature.asc
Description: OpenPGP digital signature
