1. 17 1月, 2012 14 次提交
  2. 16 12月, 2011 1 次提交
  3. 10 12月, 2011 1 次提交
    • C
      Btrfs: fix btrfs_end_bio to deal with write errors to a single mirror · 5dbc8fca
      Chris Mason 提交于
      btrfs_end_bio checks the number of errors on a bio against the max
      number of errors allowed before sending any EIOs up to the higher
      levels.
      
      If we got enough copies of the bio done for a given raid level, it is
      supposed to clear the bio error flag and return success.
      
      We have pointers to the original bio sent down by the higher layers and
      pointers to any cloned bios we made for raid purposes.  If the original
      bio happens to be the one that got an io error, but not the last one to
      finish, it might not have the BIO_UPTODATE bit set.
      
      Then, when the last bio does finish, we'll call bio_end_io on the
      original bio.  It won't have the uptodate bit set and we'll end up
      sending EIO to the higher layers.
      
      We already had a check for this, it just was conditional on getting the
      IO error on the very last bio.  Make the check unconditional so we eat
      the EIOs properly.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      5dbc8fca
  4. 08 12月, 2011 1 次提交
  5. 11 11月, 2011 1 次提交
  6. 06 11月, 2011 1 次提交
    • D
      btrfs: separate superblock items out of fs_info · 6c41761f
      David Sterba 提交于
      fs_info has now ~9kb, more than fits into one page. This will cause
      mount failure when memory is too fragmented. Top space consumers are
      super block structures super_copy and super_for_commit, ~2.8kb each.
      Allocate them dynamically. fs_info will be ~3.5kb. (measured on x86_64)
      
      Add a wrapper for freeing fs_info and all of it's dynamically allocated
      members.
      Signed-off-by: NDavid Sterba <dsterba@suse.cz>
      6c41761f
  7. 21 10月, 2011 1 次提交
  8. 20 10月, 2011 1 次提交
    • J
      Btrfs: allow us to overcommit our enospc reservations · 2bf64758
      Josef Bacik 提交于
      One of the things that kills us is the fact that our ENOSPC reservations are
      horribly over the top in most normal cases.  There isn't too much that can be
      done about this because when we are completely full we really need them to work
      like this so we don't under reserve.  However if there is plenty of unallocated
      chunks on the disk we can use that to gauge how much we can overcommit.  So this
      patch adds chunk free space accounting so we always know how much unallocated
      space we have.  Then if we fail to make a reservation within our allocated
      space, check to see if we can overcommit.  In the normal flushing case (like
      with delalloc metadata reservations) we'll take the free space and divide it by
      2 if our metadata profile is setup for DUP or any of those, and then divide it
      by 8 to make sure we don't overcommit too much.  Then if we're in a non-flushing
      case (we really need this reservation now!) we only limit ourselves to half of
      the free space.  This makes this fio test
      
      [torrent]
      filename=torrent-test
      rw=randwrite
      size=4g
      ioengine=sync
      directory=/mnt/btrfs-test
      
      go from taking around 45 minutes to 10 seconds on my freshly formatted 3 TiB
      file system.  This doesn't seem to break my other enospc tests, but could really
      use some more testing as this is a super scary change.  Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      2bf64758
  9. 02 10月, 2011 1 次提交
  10. 29 9月, 2011 2 次提交
    • J
      btrfs: Put mirror_num in bi_bdev · 2774b2ca
      Jan Schmidt 提交于
      The error correction code wants to make sure that only the bad mirror is
      rewritten. Thus, we need to know which mirror is the bad one. I did not
      find a more apropriate field than bi_bdev. But I think using this is fine,
      because it is modified by the block layer, anyway, and should not be read
      after the bio returned.
      Signed-off-by: NJan Schmidt <list.btrfs@jan-o-sch.net>
      2774b2ca
    • J
      btrfs: btrfs_multi_bio replaced with btrfs_bio · a1d3c478
      Jan Schmidt 提交于
      btrfs_bio is a bio abstraction able to split and not complete after the last
      bio has returned (like the old btrfs_multi_bio). Additionally, btrfs_bio
      tracks the mirror_num used to read data which can be used for error
      correction purposes.
      Signed-off-by: NJan Schmidt <list.btrfs@jan-o-sch.net>
      a1d3c478
  11. 17 8月, 2011 3 次提交
    • M
      Btrfs: fix uninitialized sync_pending · 0e588859
      Miao Xie 提交于
      sync_pending is uninitialized before it be used, fix it.
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      0e588859
    • L
      Btrfs: fix a bug of balance on full multi-disk partitions · 38c01b96
      liubo 提交于
      When balancing, we'll first try to shrink devices for some space,
      but if it is working on a full multi-disk partition with raid protection,
      we may encounter a bug, that is, while shrinking, total_bytes may be less
      than bytes_used, and btrfs may allocate a dev extent that accesses out of
      device's bounds.
      
      Then we will not be able to write or read the data which stores at the end
      of the device, and get the followings:
      
      device fsid 0939f071-7ea3-46c8-95df-f176d773bfb6 devid 1 transid 10 /dev/sdb5
      Btrfs detected SSD devices, enabling SSD mode
      btrfs: relocating block group 476315648 flags 9
      btrfs: found 4 extents
      attempt to access beyond end of device
      sdb5: rw=145, want=546176, limit=546147
      attempt to access beyond end of device
      sdb5: rw=145, want=546304, limit=546147
      attempt to access beyond end of device
      sdb5: rw=145, want=546432, limit=546147
      attempt to access beyond end of device
      sdb5: rw=145, want=546560, limit=546147
      attempt to access beyond end of device
      Signed-off-by: NLiu Bo <liubo2009@cn.fujitsu.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      38c01b96
    • J
      Btrfs: detect wether a device supports discard · d5e2003c
      Josef Bacik 提交于
      We have a problem where if a user specifies discard but doesn't actually support
      it we will return EOPNOTSUPP from btrfs_discard_extent.  This is a problem
      because this gets called (in a fashion) from the tree log recovery code, which
      has a nice little BUG_ON(ret) after it, which causes us to fail the tree log
      replay.  So instead detect wether our devices support discard when we're adding
      them and then don't issue discards if we know that the device doesn't support
      it.  And just for good measure set ret = 0 in btrfs_issue_discard just in case
      we still get EOPNOTSUPP so we don't screw anybody up like this again.  Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      d5e2003c
  12. 06 8月, 2011 1 次提交
  13. 28 7月, 2011 1 次提交
    • C
      Btrfs: make a lockdep class for each root · 85d4e461
      Chris Mason 提交于
      This patch was originally from Tejun Heo.  lockdep complains about the btrfs
      locking because we sometimes take btree locks from two different trees at the
      same time.  The current classes are based only on level in the btree, which
      isn't enough information for lockdep to figure out if the lock is safe.
      
      This patch makes a class for each type of tree, and lumps all the FS trees that
      actually have files and directories into the same class.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      85d4e461
  14. 26 7月, 2011 1 次提交
    • M
      btrfs: Don't BUG_ON alloc_path errors in find_next_chunk · 92b8e897
      Mark Fasheh 提交于
      I also removed the BUG_ON from error return of find_next_chunk in
      init_first_rw_device(). It turns out that the only caller of
      init_first_rw_device() also BUGS on any nonzero return so no actual behavior
      change has occurred here.
      
      do_chunk_alloc() also needed an update since it calls btrfs_alloc_chunk()
      which can now return -ENOMEM. Instead of setting space_info->full on any
      error from btrfs_alloc_chunk() I catch and return every error value _except_
      -ENOSPC. Thanks goes to Tsutomu Itoh for pointing that issue out.
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      92b8e897
  15. 15 7月, 2011 1 次提交
  16. 07 7月, 2011 1 次提交
  17. 11 6月, 2011 1 次提交
  18. 04 6月, 2011 1 次提交
  19. 24 5月, 2011 6 次提交