1. 10 8月, 2013 2 次提交
    • J
      Btrfs: make sure the backref walker catches all refs to our extent · ed8c4913
      Josef Bacik 提交于
      Because we don't mess with the offset into the extent for compressed we will
      properly find both extents for this case
      
      [extent a][extent b][rest of extent a]
      
      but because we already added a ref for the front half we won't add the inode
      information for the second half.  This causes us to leak that memory and not
      print out the other offset when we do logical-resolve.  So fix this by calling
      ulist_add_merge and then add our eie to the existing entry if there is one.
      With this patch we get both offsets out of logical-resolve.  With this and the
      other 2 patches I've sent we now pass btrfs/276 on my vm with compress-force=lzo
      set.  Thanks,
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      Signed-off-by: NChris Mason <chris.mason@fusionio.com>
      ed8c4913
    • J
      Btrfs: fix backref walking when we hit a compressed extent · 8ca15e05
      Josef Bacik 提交于
      If you do btrfs inspect-internal logical-resolve on a compressed extent that has
      been partly overwritten it won't find anything.  This is because we try and
      match the extent offset we've searched for based on the extent offset in the
      data extent entry.  However this doesn't work for compressed extents because the
      offsets are for the uncompressed size, not the compressed size.  So instead only
      do this check if we are not compressed, that way we can get an actual entry for
      the physical offset rather than nothing for compressed.  Thanks,
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      Signed-off-by: NChris Mason <chris.mason@fusionio.com>
      8ca15e05
  2. 02 7月, 2013 1 次提交
  3. 01 7月, 2013 1 次提交
    • J
      Btrfs: cleanup backref search commit root flag stuff · da61d31a
      Josef Bacik 提交于
      Looking into this backref problem I noticed we're using a macro to what turns
      out to essentially be a NULL check to see if we need to search the commit root.
      I'm killing this, let's just do what everybody else does and checks if trans ==
      NULL.  I've also made it so we pass in the path to __resolve_indirect_refs which
      will have the search_commit_root flag set properly already and that way we can
      avoid allocating another path when we have a perfectly good one to use.  Thanks,
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      da61d31a
  4. 18 5月, 2013 1 次提交
  5. 07 5月, 2013 8 次提交
  6. 27 2月, 2013 1 次提交
  7. 13 12月, 2012 2 次提交
  8. 26 10月, 2012 2 次提交
  9. 24 10月, 2012 1 次提交
  10. 09 10月, 2012 2 次提交
    • M
      btrfs: extended inode ref iteration · d24bec3a
      Mark Fasheh 提交于
      The iterate_irefs in backref.c is used to build path components from inode
      refs. This patch adds code to iterate extended refs as well.
      
      I had modify the callback function signature to abstract out some of the
      differences between ref structures. iref_to_path() also needed similar
      changes.
      Signed-off-by: NMark Fasheh <mfasheh@suse.de>
      d24bec3a
    • M
      btrfs: extended inode refs · f186373f
      Mark Fasheh 提交于
      This patch adds basic support for extended inode refs. This includes support
      for link and unlink of the refs, which basically gets us support for rename
      as well.
      
      Inode creation does not need changing - extended refs are only added after
      the ref array is full.
      Signed-off-by: NMark Fasheh <mfasheh@suse.de>
      f186373f
  11. 02 10月, 2012 4 次提交
  12. 29 8月, 2012 1 次提交
  13. 26 7月, 2012 1 次提交
  14. 10 7月, 2012 1 次提交
  15. 27 6月, 2012 2 次提交
  16. 21 6月, 2012 1 次提交
    • A
      Btrfs: don't assume to be on the correct extent in add_all_parents · 69bca40d
      Alexander Block 提交于
      add_all_parents did assume that path is already at a correct extent data
      item, which may not be true in case of data extents that were partly
      rewritten and splitted.
      
      We need to check if we're on a matching extent for every item and only
      for the ones after the first. The loop is changed to do this now.
      
      This patch also fixes a bug introduced with commit 3b127fd8 "Btrfs:
      remove obsolete btrfs_next_leaf call from __resolve_indirect_ref".
      The removal of next_leaf did sometimes result in slot==nritems when
      the above described case happens, and thus resulting in invalid values
      (e.g. wanted_obejctid) in add_all_parents (leading to missed backrefs
      or even crashes).
      Signed-off-by: NAlexander Block <ablock84@googlemail.com>
      Signed-off-by: NJan Schmidt <list.btrfs@jan-o-sch.net>
      Signed-off-by: NChris Mason <chris.mason@fusionio.com>
      69bca40d
  17. 15 6月, 2012 2 次提交
    • J
      Btrfs: add btrfs_next_old_leaf · 3d7806ec
      Jan Schmidt 提交于
      To make sense of the tree mod log, the backref walker not only needs
      btrfs_search_old_slot, but it also called btrfs_next_leaf, which in turn was
      calling btrfs_search_slot. This obviously didn't give the correct result.
      
      This commit adds btrfs_next_old_leaf, a drop-in replacement for
      btrfs_next_leaf with a time_seq parameter. If it is zero, it behaves exactly
      like btrfs_next_leaf. If it is non-zero, it will use btrfs_search_old_slot
      with this time_seq parameter.
      Signed-off-by: NJan Schmidt <list.btrfs@jan-o-sch.net>
      3d7806ec
    • J
      Btrfs: remove obsolete btrfs_next_leaf call from __resolve_indirect_ref · f617e2fd
      Jan Schmidt 提交于
      When resolving indirect refs, we used to call btrfs_next_leaf in case we
      didn't find an exact match. While we should find exact matches most of the
      time, in case we don't, we must continue searching. Treating those matches
      differently depending on the level we're searching doesn't make sense.
      
      Even worse, we might end up searching for a key larger than the largest, in
      which case there is no next_leaf and subsequent jobs would fail. This commit
      drops the bogous lines.
      Signed-off-by: NJan Schmidt <list.btrfs@jan-o-sch.net>
      f617e2fd
  18. 01 6月, 2012 1 次提交
  19. 30 5月, 2012 1 次提交
  20. 26 5月, 2012 4 次提交
    • J
      Btrfs: look into the extent during find_all_leafs · 976b1908
      Jan Schmidt 提交于
      Before this patch we called find_all_leafs for a data extent, then called
      find_all_roots and then looked into the extent to grab the information
      we were seeking. This was done without holding the leaves locked to avoid
      deadlocks. However, this can obviouly race with concurrent tree
      modifications.
      
      Instead, we now look into the extent while we're holding the lock during
      find_all_leafs and store this information together with the leaf list.
      Signed-off-by: NJan Schmidt <list.btrfs@jan-o-sch.net>
      976b1908
    • J
      Btrfs: bugfix: ignore the wrong key for indirect tree block backrefs · d5c88b73
      Jan Schmidt 提交于
      The key we store with a tree block backref is only a hint. It is set when
      the ref is created and can remain correct for a long time. As the tree is
      rebalanced, however, eventually the key no longer points to the correct
      destination.
      
      With this patch, we change find_parent_nodes to no longer add keys unless it
      knows for sure they're correct (e.g. because they're for an extent data
      backref). Then when we later encounter a backref ref with no parent and no
      key set, we grab the block and take the first key from the block itself.
      Signed-off-by: NJan Schmidt <list.btrfs@jan-o-sch.net>
      d5c88b73
    • J
      Btrfs: bugfix in btrfs_find_parent_nodes · dadcaf78
      Jan Schmidt 提交于
      That one has been around since the addition of backref.c. Due to the way we
      calculate our slot numbers, after adding inline refs we're missing one keyed
      ref unless it's located at the beginning of a new leaf.
      Reported-by: NAlexander Block <ablock84@googlemail.com>
      Signed-off-by: NJan Schmidt <list.btrfs@jan-o-sch.net>
      dadcaf78
    • J
      Btrfs: ulist realloc bugfix · cd1b413c
      Jan Schmidt 提交于
      ulist_next gets the pointer to the previously returned element to find the
      next element from there. However, when we call ulist_add while iteration
      with ulist_next is in progress (ulist explicitly supports this), we can
      realloc the ulist internal memory, which makes the pointer to the previous
      element useless.
      
      Instead, we now use an iterator parameter that's independent from the
      internal pointers.
      Reported-by: NAlexander Block <ablock84@googlemail.com>
      Signed-off-by: NJan Schmidt <list.btrfs@jan-o-sch.net>
      cd1b413c
  21. 19 4月, 2012 1 次提交