1. 26 5月, 2012 2 次提交
  2. 19 4月, 2012 3 次提交
    • J
      Btrfs: add missing read locks in backref.c · b916a59a
      Jan Schmidt 提交于
      iref_to_path and iterate_irefs both increment the eb's refcount to use it
      after releasing the path. Both depend on consistent data remaining in the
      extent buffer and need a read lock to protect it.
      Signed-off-by: NJan Schmidt <list.btrfs@jan-o-sch.net>
      b916a59a
    • J
      Btrfs: don't call free_extent_buffer twice in iterate_irefs · aefc1eb1
      Jan Schmidt 提交于
      Avoid calling free_extent_buffer more than once when the iterator function
      returns non-zero. The only code that uses this is scrub repair for corrupted
      nodatasum blocks.
      Signed-off-by: NJan Schmidt <list.btrfs@jan-o-sch.net>
      aefc1eb1
    • J
      Btrfs: Make free_ipath() deal gracefully with NULL pointers · 4735fb28
      Jesper Juhl 提交于
      Make free_ipath() behave like most other freeing functions in the
      kernel and gracefully do nothing when passed a NULL pointer.
      
      Besides this making the bahaviour consistent with functions such as
      kfree(), vfree(), btrfs_free_path() etc etc, it also fixes a real NULL
      deref issue in fs/btrfs/ioctl.c::btrfs_ioctl_ino_to_path(). In that
      function we have this code:
      
      ...
              ipath = init_ipath(size, root, path);
              if (IS_ERR(ipath)) {
                      ret = PTR_ERR(ipath);
                      ipath = NULL;
                      goto out;
              }
      ...
      out:
              btrfs_free_path(path);
              free_ipath(ipath);
      ...
      
      If we ever take the true branch of that 'if' statement we'll end up
      passing a NULL pointer to free_ipath() which will subsequently
      dereference it and we'll go "Boom" :-(
      This patch will avoid that.
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      4735fb28
  3. 27 3月, 2012 2 次提交
    • I
      Btrfs: fix memory leak in resolver code · 5eb56d25
      Ilya Dryomov 提交于
      init_ipath() allocates btrfs_data_container which is never freed.  Free
      it in free_ipath() and nuke the comment for init_data_container() - we
      can safely free it with kfree().
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      5eb56d25
    • J
      Btrfs: fix regression in scrub path resolving · 7a3ae2f8
      Jan Schmidt 提交于
      In commit 4692cf58 we introduced new backref walking code for btrfs. This
      assumes we're searching live roots, which requires a transaction context.
      While scrubbing, however, we must not join a transaction because this could
      deadlock with the commit path. Additionally, what scrub really wants to do
      is resolving a logical address in the commit root it's currently checking.
      
      This patch adds support for logical to path resolving on commit roots and
      makes scrub use that.
      Signed-off-by: NJan Schmidt <list.btrfs@jan-o-sch.net>
      7a3ae2f8
  4. 03 3月, 2012 1 次提交
  5. 15 2月, 2012 1 次提交
    • J
      Btrfs: avoid positive number with ERR_PTR · 8f24b496
      Jan Schmidt 提交于
      inode_ref_info() returns 1 when the element wasn't found and < 0 on error,
      just like btrfs_search_slot(). In iref_to_path() it's an error when the
      inode ref can't be found, thus we return ERR_PTR(ret) in that case. In order
      to avoid ERR_PTR(1), we now set ret to -ENOENT in that case.
      Signed-off-by: NJan Schmidt <list.btrfs@jan-o-sch.net>
      8f24b496
  6. 27 1月, 2012 1 次提交
  7. 05 1月, 2012 1 次提交
    • J
      Btrfs: new backref walking code · 4692cf58
      Jan Schmidt 提交于
      The old backref iteration code could only safely be used on commit roots.
      Besides this limitation, it had bugs in finding the roots for these
      references. This commit replaces large parts of it by btrfs_find_all_roots()
      which a) really finds all roots and the correct roots, b) works correctly
      under heavy file system load, c) considers delayed refs.
      Signed-off-by: NJan Schmidt <list.btrfs@jan-o-sch.net>
      4692cf58
  8. 04 1月, 2012 1 次提交
  9. 20 11月, 2011 1 次提交
    • J
      btrfs: Fix up 32/64-bit compatibility for new ioctls · 745c4d8e
      Jeff Mahoney 提交于
       This patch casts to unsigned long before casting to a pointer and fixes
       the following warnings:
      fs/btrfs/extent_io.c:2289:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      fs/btrfs/ioctl.c:2933:37: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      fs/btrfs/ioctl.c:2937:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      fs/btrfs/ioctl.c:3020:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      fs/btrfs/scrub.c:275:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      fs/btrfs/backref.c:686:27: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      Signed-off-by: NJeff Mahoney <jeffm@suse.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      745c4d8e
  10. 06 11月, 2011 1 次提交
  11. 29 9月, 2011 1 次提交