All of lore.kernel.org
 help / color / mirror / Atom feed
* Fresh Raid-1 setup, dump-tree shows invalid owner id
@ 2017-01-30  1:54 Lakshmipathi.G
  2017-01-30 11:34 ` Lakshmipathi.G
  2017-01-30 11:43 ` Hans van Kranenburg
  0 siblings, 2 replies; 5+ messages in thread
From: Lakshmipathi.G @ 2017-01-30  1:54 UTC (permalink / raw)
  To: linux-btrfs

After creating raid1:
$./mkfs.btrfs -f -d raid1 -m raid1 /dev/sda6 /dev/sda7

and using
$./btrfs inspect-internal dump-tree /dev/sda6  #./btrfs-debug-tree /dev/sda6

shows possible wrong value for 'owner'? 
--
checksum tree key (CSUM_TREE ROOT_ITEM 0) 
leaf 29425664 items 0 free space 16283 generation 4 owner 7
fs uuid 94fee00b-00aa-4d69-b947-347f743117f2
chunk uuid 6477561c-cbca-45e4-980d-56727a8dc9d9
data reloc tree key (DATA_RELOC_TREE ROOT_ITEM 0) 
leaf 29442048 items 2 free space 16061 generation 4 owner 18446744073709551607 <<< owner id?
fs uuid 94fee00b-00aa-4d69-b947-347f743117f2
chunk uuid 6477561c-cbca-45e4-980d-56727a8dc9d9
--

or is that expected output?

Cheers.
Lakshmipathi.G

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fresh Raid-1 setup, dump-tree shows invalid owner id
  2017-01-30  1:54 Fresh Raid-1 setup, dump-tree shows invalid owner id Lakshmipathi.G
@ 2017-01-30 11:34 ` Lakshmipathi.G
  2017-01-30 11:43 ` Hans van Kranenburg
  1 sibling, 0 replies; 5+ messages in thread
From: Lakshmipathi.G @ 2017-01-30 11:34 UTC (permalink / raw)
  To: btrfs

Raid1 is irrelevant, looks like this happen with simple case too.
$./mkfs.btrfs tests/test.img
$./btrfs-debug-tree tests/test.img

possible issue with ./btrfs-debug-tree stdout?

On Mon, Jan 30, 2017 at 7:24 AM, Lakshmipathi.G
<lakshmipathi.g@giis.co.in> wrote:
> After creating raid1:
> $./mkfs.btrfs -f -d raid1 -m raid1 /dev/sda6 /dev/sda7
>
> and using
> $./btrfs inspect-internal dump-tree /dev/sda6  #./btrfs-debug-tree /dev/sda6
>
> shows possible wrong value for 'owner'?
> --
> checksum tree key (CSUM_TREE ROOT_ITEM 0)
> leaf 29425664 items 0 free space 16283 generation 4 owner 7
> fs uuid 94fee00b-00aa-4d69-b947-347f743117f2
> chunk uuid 6477561c-cbca-45e4-980d-56727a8dc9d9
> data reloc tree key (DATA_RELOC_TREE ROOT_ITEM 0)
> leaf 29442048 items 2 free space 16061 generation 4 owner 18446744073709551607 <<< owner id?
> fs uuid 94fee00b-00aa-4d69-b947-347f743117f2
> chunk uuid 6477561c-cbca-45e4-980d-56727a8dc9d9
> --
>
> or is that expected output?
>
> Cheers.
> Lakshmipathi.G
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fresh Raid-1 setup, dump-tree shows invalid owner id
  2017-01-30  1:54 Fresh Raid-1 setup, dump-tree shows invalid owner id Lakshmipathi.G
  2017-01-30 11:34 ` Lakshmipathi.G
@ 2017-01-30 11:43 ` Hans van Kranenburg
  2017-01-30 12:37   ` Lakshmipathi.G
  1 sibling, 1 reply; 5+ messages in thread
From: Hans van Kranenburg @ 2017-01-30 11:43 UTC (permalink / raw)
  To: Lakshmipathi.G, linux-btrfs

On 01/30/2017 02:54 AM, Lakshmipathi.G wrote:
> After creating raid1:
> $./mkfs.btrfs -f -d raid1 -m raid1 /dev/sda6 /dev/sda7
> 
> and using
> $./btrfs inspect-internal dump-tree /dev/sda6  #./btrfs-debug-tree /dev/sda6
> 
> shows possible wrong value for 'owner'? 
> --
> checksum tree key (CSUM_TREE ROOT_ITEM 0) 
> leaf 29425664 items 0 free space 16283 generation 4 owner 7
> fs uuid 94fee00b-00aa-4d69-b947-347f743117f2
> chunk uuid 6477561c-cbca-45e4-980d-56727a8dc9d9
> data reloc tree key (DATA_RELOC_TREE ROOT_ITEM 0) 
> leaf 29442048 items 2 free space 16061 generation 4 owner 18446744073709551607 <<< owner id?
> fs uuid 94fee00b-00aa-4d69-b947-347f743117f2
> chunk uuid 6477561c-cbca-45e4-980d-56727a8dc9d9
> --
> 
> or is that expected output?

Yes, the owner is the number of the tree.

DATA_RELOC_TREE is -9, but then unsigned 64 bits.

>>> -9 + 2**64
18446744073709551607L

So the result is a number that's close to the max or 64 bits.

You can find those numbers in the kernel source in
  include/uapi/linux/btrfs_tree.h

e.g.:

#define BTRFS_DATA_RELOC_TREE_OBJECTID -9ULL

-- 
Hans van Kranenburg

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fresh Raid-1 setup, dump-tree shows invalid owner id
  2017-01-30 11:43 ` Hans van Kranenburg
@ 2017-01-30 12:37   ` Lakshmipathi.G
  2017-03-13 17:34     ` David Sterba
  0 siblings, 1 reply; 5+ messages in thread
From: Lakshmipathi.G @ 2017-01-30 12:37 UTC (permalink / raw)
  To: Hans van Kranenburg; +Cc: btrfs

>
> Yes, the owner is the number of the tree.
>
> DATA_RELOC_TREE is -9, but then unsigned 64 bits.
>
>>>> -9 + 2**64
> 18446744073709551607L
>
> So the result is a number that's close to the max or 64 bits.
>
> You can find those numbers in the kernel source in
>   include/uapi/linux/btrfs_tree.h
>
> e.g.:
>
> #define BTRFS_DATA_RELOC_TREE_OBJECTID -9ULL
>

Thanks for the details. This owner number looked different from other
owner ids, so wanted to check on the same, now understood.

Cheers.
Lakshmipathi.G

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fresh Raid-1 setup, dump-tree shows invalid owner id
  2017-01-30 12:37   ` Lakshmipathi.G
@ 2017-03-13 17:34     ` David Sterba
  0 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2017-03-13 17:34 UTC (permalink / raw)
  To: Lakshmipathi.G; +Cc: Hans van Kranenburg, btrfs

On Mon, Jan 30, 2017 at 06:07:01PM +0530, Lakshmipathi.G wrote:
> >
> > Yes, the owner is the number of the tree.
> >
> > DATA_RELOC_TREE is -9, but then unsigned 64 bits.
> >
> >>>> -9 + 2**64
> > 18446744073709551607L
> >
> > So the result is a number that's close to the max or 64 bits.
> >
> > You can find those numbers in the kernel source in
> >   include/uapi/linux/btrfs_tree.h
> >
> > e.g.:
> >
> > #define BTRFS_DATA_RELOC_TREE_OBJECTID -9ULL
> >
> 
> Thanks for the details. This owner number looked different from other
> owner ids, so wanted to check on the same, now understood.

Recently, in the commit 6f6b643e44ef7, the known tree ids are printed as
the small negative numbers. We can also do that in progs, however we'd
need some tricks so we don't duplicate all format strings one with %llu
and one with %lld. Something like

format: "%s%llu"
values:
  id > LAST_FREE ? "-" : ""
  id > LAST_FREE ? 2^64 - id : id

and  hidden in helpers etc.

I don't think we should replace all references to tree ids with the
symbolic names as they're used in keys so searching for the numeric
value in the dump output would miss something or make the regexp more
complicated. I won't object against making the tree id output format
selectable by option though.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-03-13 17:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-30  1:54 Fresh Raid-1 setup, dump-tree shows invalid owner id Lakshmipathi.G
2017-01-30 11:34 ` Lakshmipathi.G
2017-01-30 11:43 ` Hans van Kranenburg
2017-01-30 12:37   ` Lakshmipathi.G
2017-03-13 17:34     ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.