1. 27 3月, 2012 1 次提交
    • C
      Btrfs: allow metadata blocks larger than the page size · 727011e0
      Chris Mason 提交于
      A few years ago the btrfs code to support blocks lager than
      the page size was disabled to fix a few corner cases in the
      page cache handling.  This fixes the code to properly support
      large metadata blocks again.
      
      Since current kernels will crash early and often with larger
      metadata blocks, this adds an incompat bit so that older kernels
      can't mount it.
      
      This also does away with different blocksizes for nodes and leaves.
      You get a single block size for all tree blocks.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      727011e0
  2. 23 2月, 2012 1 次提交
    • C
      Btrfs: make sure we update latest_bdev · a6b0d5c8
      Chris Mason 提交于
      When we are setting up the mount, we close all the
      devices that were not actually part of the metadata we found.
      
      But, we don't make sure that one of those devices wasn't
      fs_devices->latest_bdev, which means we can do a use after free
      on the one we closed.
      
      This updates latest_bdev as it goes.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      a6b0d5c8
  3. 17 2月, 2012 1 次提交
  4. 15 2月, 2012 1 次提交
    • D
      btrfs: silence warning in raid array setup · 8a334426
      David Sterba 提交于
      Raid array setup code creates an extent buffer in an usual way. When the
      PAGE_CACHE_SIZE is > super block size, the extent pages are not marked
      up-to-date, which triggers a WARN_ON in the following
      write_extent_buffer call. Add an explicit up-to-date call to silence the
      warning.
      Signed-off-by: NDavid Sterba <dsterba@suse.cz>
      8a334426
  5. 17 1月, 2012 18 次提交
  6. 11 1月, 2012 4 次提交
  7. 09 1月, 2012 1 次提交
    • A
      btrfs: fix a deadlock in btrfs_scan_one_device() · 10f6327b
      Al Viro 提交于
      pathname resolution under a global mutex, taken on some paths in ->mount()
      is a Bad Idea(tm) - think what happens if said pathname resolution triggers
      automount of some btrfs instance and walks into attempt to grab the same
      mutex.  Deadlock - we are waiting for daemon to finish walking the path,
      daemon is waiting for us to release the mutex...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      10f6327b
  8. 07 1月, 2012 1 次提交
  9. 22 12月, 2011 1 次提交
    • S
      Btrfs: integrate integrity check module into btrfs · 21adbd5c
      Stefan Behrens 提交于
      This is the last part of the patch series. It modifies the btrfs
      code to use the integrity check module if configured to do so
      with the define BTRFS_FS_CHECK_INTEGRITY. If this define is not set,
      the only effective change is that code is added that handles the
      mount option to activate the integrity check. If the mount option is
      set and the define BTRFS_FS_CHECK_INTEGRITY is not set, that code
      complains in the log and the mount fails with EINVAL.
      
      Add the mount option to activate the usage of the integrity check
      code.
      Add invocation of btrfs integrity check code init and cleanup
      function on mount and umount, respectively.
      Add hook to call btrfs integrity check code version of
      submit_bh/submit_bio.
      Signed-off-by: NStefan Behrens <sbehrens@giantdisaster.de>
      21adbd5c
  10. 16 12月, 2011 1 次提交
  11. 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
  12. 08 12月, 2011 1 次提交
  13. 11 11月, 2011 1 次提交
  14. 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
  15. 21 10月, 2011 1 次提交
  16. 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
  17. 02 10月, 2011 1 次提交
  18. 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
  19. 17 8月, 2011 1 次提交