1. 14 6月, 2013 30 次提交
  2. 09 6月, 2013 5 次提交
  3. 18 5月, 2013 5 次提交
    • C
    • C
      Btrfs: use a btrfs bioset instead of abusing bio internals · 9be3395b
      Chris Mason 提交于
      Btrfs has been pointer tagging bi_private and using bi_bdev
      to store the stripe index and mirror number of failed IOs.
      
      As bios bubble back up through the call chain, we use these
      to decide if and how to retry our IOs.  They are also used
      to count IO failures on a per device basis.
      
      Recently a bio tracepoint was added lead to crashes because
      we were abusing bi_bdev.
      
      This commit adds a btrfs bioset, and creates explicit fields
      for the mirror number and stripe index.  The plan is to
      extend this structure for all of the fields currently in
      struct btrfs_bio, which will mean one less kmalloc in
      our IO path.
      Signed-off-by: NChris Mason <chris.mason@fusionio.com>
      Reported-by: NTejun Heo <tj@kernel.org>
      9be3395b
    • J
      Btrfs: make sure roots are assigned before freeing their nodes · 655b09fe
      Josef Bacik 提交于
      If we fail to load the chunk tree we'll call free_root_pointers, except we may
      not have assigned the roots for the dev_root/extent_root/csum_root yet, so we
      could NULL pointer deref at this point.  Just add checks to make sure these
      roots are set to keep us from panicing.  Thanks,
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      655b09fe
    • S
      Btrfs: explicitly use global_block_rsv for quota_tree · 3a6cad90
      Stefan Behrens 提交于
      The quota_tree was set up to use the empty_block_rsv before
      which would be problematic when the filesystem is filled up
      and ENOSPC happens during internal operations while the quota
      tree is updated and COWed (when the btrfs_qgroup_info_item
      items) are written. In fact, use_block_rsv() which is used
      in btrfs_cow_block() falls back to the global_block_rsv in
      this case. But just in order to make it more clear what is
      happening, change it to explicitly use the global_block_rsv.
      Signed-off-by: NStefan Behrens <sbehrens@giantdisaster.de>
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      3a6cad90
    • A
      btrfs: do away with non-whole_page extent I/O · 17a5adcc
      Alexandre Oliva 提交于
      end_bio_extent_readpage computes whole_page based on bv_offset and
      bv_len, without taking into account that blk_update_request may modify
      them when some of the blocks to be read into a page produce a read
      error.  This would cause the read to unlock only part of the file
      range associated with the page, which would in turn leave the entire
      page locked, which would not only keep the process blocked instead of
      returning -EIO to it, but also prevent any further access to the file.
      
      It turns out that btrfs always issues whole-page reads and writes.
      The special handling of non-whole_page appears to be a mistake or a
      left-over from a time when this wasn't the case.  Indeed,
      end_bio_extent_writepage distinguished between whole_page and
      non-whole_page writes but behaved identically in both cases!
      
      I've replaced the whole_page computations with warnings, just to be
      sure that we're not issuing partial page reads or writes.  The
      warnings should probably just go away some time.
      Signed-off-by: NAlexandre Oliva <oliva@gnu.org>
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      17a5adcc