Re: [PATCH 2/2] btrfs: pretty print leaked root name

David Sterba
2020-08-24T11:32:06Z

On Fri, Aug 21, 2020 at 10:00:35AM -0400, Josef Bacik wrote:
> On 8/21/20 6:13 AM, David Sterba wrote:
> > On Fri, Aug 21, 2020 at 10:35:38AM +0300, Nikolay Borisov wrote:
> >>> root = list_first_entry(&fs_info->allocated_roots,
> >>> struct btrfs_root, leak_list);
> >>> - btrfs_err(fs_info, "leaked root %llu-%llu refcount %d",
> >>> - root->root_key.objectid, root->root_key.offset,
> >>> - refcount_read(&root->refs));
> >>> + btrfs_err(fs_info, "leaked root %s%lld-%llu refcount %d",
> >>
> >> nit: Won't this string result in some rather awkward looking strings,
> >> such as:
> >>
> >> "leaked root ROOT_TREE<objectid>-<offset>..." i.e shouldn't the
> >> (objectid,offset) pair be marked with parentheses?
> >
> > I don't understand why need/want to print the offset here. It is from
> > the key.offset but for a message we should print it in an understandable
> > way.
>
> The offset matters for the TREE_RELOC roots, because it's the object id
> of the fs root that the reloc root refers to. Thanks,

Ok, that makes sense to print, though printing it as offset=... looks
confusing. Could it be rephrased to refer to the fs tree and reloc tree?