Opened 16 years ago

Closed 16 years ago

#2661 closed bug (invalid)

bfs : 1397 : Name in use.

Reported by: bga Owned by: axeld
Priority: normal Milestone: R1
Component: File Systems/BFS Version: R1/pre-alpha1
Keywords: Cc: andreas.faerber@…
Blocked By: Blocking:
Platform: All

Description

These seem to be harmless messages that show on syslog but I guess I manage to track it to what I think is a bug (completely by chance, as I was investigating bug #2614.

All the times I am getting this message it is happening when writting the last_modified attribute to files. The reason it does that is because it seems this index does not allow duplicates. This is kinda weird because I see no reason for it not to accept duplicates (a duplicate here is 2 files with the same modification date, which can happen (and, in fact, does) all the time. So I went to check how this is set and I noticed it uses the following code in BPlusTree.cpp to figure if the index allows duplicates or not:

BPlusTree.cpp : BPlusTree::SetTo().

	fAllowDuplicates = ((stream->Mode() & S_INDEX_DIR) == S_INDEX_DIR
			&& stream->BlockRun() != stream->Parent())
		|| (stream->Mode() & S_ALLOW_DUPS) != 0;

fAllowDuplicates is initialized by default as being true and is only changed when SetTo() is called. S_ALLOW_DUPS is not set anywhere in the BFS code, stream->Mode() must have S_INDEX_DIR set (either this or the bug is in this point) so it seems the problem is the stream->BlockRun() != stream->Parent() check. What is its intent exactly? And why does it seem it has a different behaviour for last_modified when compared to the behavious in, say, size or name indexes?

Change History (11)

comment:1 by andreasf, 16 years ago

Cc: andreas.faerber@… added

comment:2 by axeld, 16 years ago

Your file system must be messed up, then. The code itself is okay, and "last_modified" definitely allows duplicates over here.

The intent of the test is to differentiate indices from the index root directory. I've now replaced it with Inode::IsIndex() which makes this a lot clearer (it obviously added this later).

Unless you keep having problems with this, please close this bug as invalid.

comment:3 by anevilyak, 16 years ago

I see this warning relatively often during things like svn up here, albeit with a different number, in my case 1307. I've reinitialized that partition a few times in the past, but it's probably been a week or two now.

comment:4 by anevilyak, 16 years ago

I forgot to mention, mine also specifically names the Insert operation, unless that was just accidentally omitted from the ticket title.

comment:5 by bga, 16 years ago

I will try a full install later today to check the possibility of the partition being messed up (I don't think this is the case tough).

comment:6 by axeld, 16 years ago

Have a look at your indices using "bfsinfo" - then you can see what values are possibly wrong. You could also add a dump of the inode ID to see which node affected.

The warning itself is harmless in the context it usually happens. I guess I'll just remove it once this is solved.

comment:7 by anevilyak, 16 years ago

Assuming you mean the version of bfsinfo on bebits, how do I determine what block the inode is located at? It seems to want the block number.

comment:8 by anevilyak, 16 years ago

The index dir itself, for reference:

/HaikuData/home/devel/BFS-tools> ./bfsinfo -ib /dev/disk/ata/3/master/2 0 8841
Copyright (c) 2001-2008 pinc Software.

Inode at block 8841:
-----------------------------------------
inode "(null)":
  magic1             = 3bbe0ad9 (;...) valid
  inode_num          = (0, 8841, 1)
  uid                = 0
  gid                = 0
  mode               = 4100040700 (octal)
  flags              = 00000001
  create_time        = Fri Aug 29 19:22:08 2008
  last_modified_time = Fri Aug 29 19:22:08 2008
  parent             = (0, 8841, 1)
  attributes         = (0, 0, 0)
  type               = 0
  inode_size         = 2048
  etc                = 00000000
  short_symlink      = -
data_stream:
  direct[00]                = (0, 8842, 32)
  max_direct_range          = 65536
  max_indirect_range        = 0
  max_double_indirect_range = 0
  size                      = 2048
  --
small data section (max. 1816 bytes):

B+Tree at block 8841:
-----------------------------------------
bplustree_header:
  magic                = 0x69f6c2e8 (i...) valid
  node_size            = 1024
  max_number_of_levels = 1
  data_type            = 0
  root_node_pointer    = 1024
  free_node_pointer    = -1
  maximum_size         = 2048


-------------------
** node at offset: 1024
** used: 190 bytes
bplustree_node (leaf node):
  left_link      = -1
  right_link     = -1
  overflow_link  = -1
  all_key_count  = 7
  all_key_length = 89

   0. "BEOS:APP_SIG" (12 bytes) -> 15641 (0, 15641)
   1. "_trk/qrylastchange" (18 bytes) -> 15770 (0, 15770)
   2. "_trk/recentQuery" (16 bytes) -> 15803 (0, 15803)
   3. "be:deskbar_item_status" (22 bytes) -> 15836 (0, 15836)
   4. "last_modified" (13 bytes) -> 8907 (0, 8907)
   5. "name" (4 bytes) -> 8874 (0, 8874)
   6. "size" (4 bytes) -> 8940 (0, 8940)

comment:9 by axeld, 16 years ago

It doesn't need the block number, the allocation group/block pair will do as well, just call it like this:

$ bfsinfo -i <device/path> 0,8940

To get info about the name index in the example above.

comment:10 by anevilyak, 16 years ago

Assuming you meant 8874, that yields:

Inode at block 8874:
-----------------------------------------
inode "(null)":
  magic1             = 3bbe0ad9 (;...) valid
  inode_num          = (0, 8874, 1)
  uid                = 0
  gid                = 0
  mode               = 4100040000 (octal)
  flags              = 00000001
  create_time        = Fri Aug 29 19:22:08 2008
  last_modified_time = Fri Aug 29 19:22:08 2008
  parent             = (0, 8841, 1)
  attributes         = (0, 0, 0)
  type               = 1129534546
  inode_size         = 2048
  etc                = 00000000
  short_symlink      = -
data_stream:
  direct[00]                = (0, 8875, 32)
  direct[01]                = (0, 8973, 32)
  direct[02]                = (0, 9069, 32)
  direct[03]                = (0, 9165, 32)
  direct[04]                = (0, 9229, 32)
  direct[05]                = (0, 9325, 32)
  direct[06]                = (0, 9389, 32)
  direct[07]                = (0, 9453, 32)
  direct[08]                = (0, 9549, 32)
  direct[09]                = (0, 9613, 32)
  direct[10]                = (0, 9709, 32)
  direct[11]                = (0, 9805, 32)
  max_direct_range          = 786432
  indirect                  = (0, 9933, 4)
  max_indirect_range        = 5177344
  max_double_indirect_range = 0
  size                      = 5136384
  --
indirect stream:
  indirect[00]              = (0, 9901, 32)
  indirect[01]              = (0, 10001, 32)
  indirect[02]              = (0, 10069, 32)
  indirect[03]              = (0, 10165, 32)
  indirect[04]              = (0, 10261, 32)
  indirect[05]              = (0, 10329, 32)
  indirect[06]              = (0, 10425, 32)
  indirect[07]              = (0, 10521, 32)
  indirect[08]              = (0, 10585, 32)
  indirect[09]              = (0, 10681, 32)
  indirect[10]              = (0, 10809, 32)
  indirect[11]              = (0, 10905, 32)
  indirect[12]              = (0, 10969, 32)
  indirect[13]              = (0, 11033, 32)
  indirect[14]              = (0, 11129, 32)
  indirect[15]              = (0, 11225, 32)
  indirect[16]              = (0, 11321, 32)
  indirect[17]              = (0, 11417, 32)
  indirect[18]              = (0, 11545, 32)
  indirect[19]              = (0, 11673, 32)
  indirect[20]              = (0, 11769, 32)
  indirect[21]              = (0, 11865, 32)
  indirect[22]              = (0, 11961, 32)
  indirect[23]              = (0, 12057, 32)
  indirect[24]              = (0, 12185, 32)
  indirect[25]              = (0, 12345, 32)
  indirect[26]              = (0, 12441, 32)
  indirect[27]              = (0, 12537, 32)
  indirect[28]              = (0, 12665, 32)
  indirect[29]              = (0, 12729, 32)
  indirect[30]              = (0, 12793, 32)
  indirect[31]              = (0, 12889, 32)
  indirect[32]              = (0, 12953, 32)
  indirect[33]              = (0, 13049, 32)
  indirect[34]              = (0, 13145, 32)
  indirect[35]              = (0, 13241, 64)
  indirect[36]              = (0, 13369, 32)
  indirect[37]              = (0, 13465, 32)
  indirect[38]              = (0, 13561, 32)
  indirect[39]              = (0, 13657, 32)
  indirect[40]              = (0, 13753, 32)
  indirect[41]              = (0, 13849, 32)
  indirect[42]              = (0, 13913, 32)
  indirect[43]              = (0, 14009, 32)
  indirect[44]              = (0, 14105, 32)
  indirect[45]              = (0, 14201, 32)
  indirect[46]              = (0, 14297, 32)
  indirect[47]              = (0, 14393, 32)
  indirect[48]              = (0, 14457, 32)
  indirect[49]              = (0, 14521, 32)
  indirect[50]              = (0, 14617, 32)
  indirect[51]              = (0, 14681, 32)
  indirect[52]              = (0, 14777, 32)
  indirect[53]              = (0, 14873, 32)
  indirect[54]              = (0, 14937, 32)
  indirect[55]              = (0, 15033, 32)
  indirect[56]              = (0, 15129, 32)
  indirect[57]              = (0, 15225, 32)
  indirect[58]              = (0, 15321, 32)
  indirect[59]              = (0, 15417, 32)
  indirect[60]              = (0, 15513, 32)
  indirect[61]              = (0, 15674, 32)
  indirect[62]              = (0, 15738, 32)
  indirect[63]              = (0, 15869, 32)
  indirect[64]              = (0, 16029, 32)
  indirect[65]              = (0, 16093, 32)
small data section (max. 1816 bytes):

comment:11 by axeld, 16 years ago

Resolution: invalid
Status: newclosed

Closing this as invalid. At least the occasions where I tracked down the cause were always harmless, and Ingo now even removed the annoying message :-)

Note: See TracTickets for help on using tickets.