Re: [bug] radix_tree_gang_lookup_tag_slot() looping endlessly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  Hi Dave,

On Thu 19-08-10 23:25:52, Dave Chinner wrote:
> It looks to me like radix_tree_set_tag_if_tagged() is fundamentally
> broken.  All the tag set/clear code stores the tree path in a cursor
> and uses that to propagate the tags if and only if the full path
> from root to leaf is resolved. radix_tree_set_tag_if_tagged() sets
> tags on intermediate nodes before it has resolved the full path and
> hence can set tags when it should not. The "should not" cases occur
> when we have to tag sub-ranges or the scan aborts because it's
> reached the number ot tag in a batch.
  Thanks for debugging this! You are right that the code can leave dangling
tag when we end the scan at the end of given range but the first tagged
leaf is after the end of the given range (there shouldn't be a problem with
the batches because there we can exit only just after we tag a leaf so that
should be OK).
  There are two possibilities how to fix the bug:
a) Always tag bottom up - i.e., when we see leaf that should be tagged, go
up and tag the parent as well if it is not already tagged.
b) When we exit the search and we didn't not set any leaf tag since last
time we went down, we walk up the tree and do an equivalent of
radix_tree_clear_tag().
  I'll probably go for a) since it looks more robust but b) would be
probably faster.

								Honza
-- 
Jan Kara <jack@xxxxxxx>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux