12 Nov, 2013

1 commit


01 Sep, 2013

6 commits


10 Aug, 2013

2 commits

  • 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: Josef Bacik
    Signed-off-by: Chris Mason

    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: Josef Bacik
    Signed-off-by: Chris Mason

    Josef Bacik
     

02 Jul, 2013

1 commit

  • I missed fixing the backref stuff when I introduced the skinny metadata. If you
    try and do things like snapshot aware defrag with skinny metadata you are going
    to see tons of warnings related to the backref count being less than 0. This is
    because the delayed refs will be found for stuff just fine, but it won't find
    the skinny metadata extent refs. With this patch I'm not seeing warnings
    anymore. Thanks,

    Reviewed-by: Liu Bo
    Signed-off-by: Josef Bacik

    Josef Bacik
     

01 Jul, 2013

1 commit

  • 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: Josef Bacik

    Josef Bacik
     

18 May, 2013

1 commit


07 May, 2013

8 commits


27 Feb, 2013

1 commit

  • When a subvolume is removed, we remove the root item from the root tree,
    while the tree blocks and backrefs remain for a while. When backref walking
    comes across one of those orphan tree blocks, it can find a backref for a
    no longer existing root. This is all good, we only must tolerate
    __resolve_indirect_ref returning an error and continue with the good refs
    found.

    Reported-by: Alex Lyakas
    Signed-off-by: Jan Schmidt
    Signed-off-by: Josef Bacik

    Jan Schmidt
     

13 Dec, 2012

2 commits

  • When __merge_refs merges two refs, it is also needed to merge the
    inode_list of both refs. Otherwise we have missed backrefs and memory
    leaks. This happens for example if two inodes share an extent and
    both lie in the same leaf and thus also have the same parent.

    Signed-off-by: Alexander Block
    Reviewed-by: Jan Schmidt
    Signed-off-by: Chris Mason

    Alexander Block
     
  • Just use WARN_ON rather than an if containing only WARN_ON(1).

    A simplified version of the semantic patch that makes this transformation
    is as follows: (http://coccinelle.lip6.fr/)

    //
    @@
    expression e;
    @@
    - if (e) WARN_ON(1);
    + WARN_ON(e);
    //

    Signed-off-by: Julia Lawall
    Reviewed-by: David Sterba
    Signed-off-by: Chris Mason

    Julia Lawall
     

26 Oct, 2012

3 commits


24 Oct, 2012

1 commit

  • In btrfs_find_all_roots' termination condition, we compare the level of the
    old buffer we got from btrfs_search_old_slot to the level of the current
    root node. We'd better compare it to the level of the rewinded root node.

    Signed-off-by: Jan Schmidt

    Jan Schmidt
     

09 Oct, 2012

2 commits

  • 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: Mark Fasheh

    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: Mark Fasheh

    Mark Fasheh
     

02 Oct, 2012

4 commits

  • This is the change of the kernel side.

    Translation of logical to inode used to have an upper limit 4k on
    inode container's size, but the limit is not large enough for a data
    with a great many of refs, so when resolving logical address,
    we can end up with
    "ioctl ret=0, bytes_left=0, bytes_missing=19944, cnt=510, missed=2493"

    This changes to regard 64k as the upper limit and use vmalloc instead of
    kmalloc to get memory more easily.

    Signed-off-by: Josef Bacik
    Signed-off-by: Liu Bo

    Liu Bo
     
  • In logical resolve, we parse extent_from_logical()'s 'ret' as a kind of flag.

    It is possible to lose our errors because
    (-EXXXX & BTRFS_EXTENT_FLAG_TREE_BLOCK) is true.

    I'm not sure if it is on purpose, it just looks too hacky if it is.
    I'd rather use a real flag and a 'ret' to catch errors.

    Acked-by: Jan Schmidt
    Signed-off-by: Liu Bo

    Liu Bo
     
  • Signed-off-by: Jan Schmidt
    Signed-off-by: Chris Mason

    Jan Schmidt
     
  • Btrfs send/receive uses the aux field to store inode numbers. On
    32 bit machines this may become a problem.

    Also fix all users of ulist_add and ulist_add_merged.

    Reported-by: Arne Jansen
    Signed-off-by: Alexander Block

    Alexander Block
     

29 Aug, 2012

1 commit


26 Jul, 2012

2 commits


10 Jul, 2012

1 commit

  • We've got two mechanisms both required for reliable backref resolving (tree
    mod log and holding back delayed refs). You cannot make use of one without
    the other. So instead of requiring the user of this mechanism to setup both
    correctly, we join them into a single interface.

    Additionally, we stop inserting non-blockers into fs_info->tree_mod_seq_list
    as we did before, which was of no value.

    Signed-off-by: Jan Schmidt

    Jan Schmidt
     

27 Jun, 2012

2 commits


21 Jun, 2012

1 commit

  • 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: Alexander Block
    Signed-off-by: Jan Schmidt
    Signed-off-by: Chris Mason

    Alexander Block