1. 24 7月, 2012 1 次提交
  2. 03 7月, 2012 3 次提交
  3. 15 6月, 2012 1 次提交
    • J
      Btrfs: use rcu to protect device->name · 606686ee
      Josef Bacik 提交于
      Al pointed out that we can just toss out the old name on a device and add a
      new one arbitrarily, so anybody who uses device->name in printk could
      possibly use free'd memory.  Instead of adding locking around all of this he
      suggested doing it with RCU, so I've introduced a struct rcu_string that
      does just that and have gone through and protected all accesses to
      device->name that aren't under the uuid_mutex with rcu_read_lock().  This
      protects us and I will use it for dealing with removing the device that we
      used to mount the file system in a later patch.  Thanks,
      Reviewed-by: NDavid Sterba <dsterba@suse.cz>
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      606686ee
  4. 30 5月, 2012 4 次提交
  5. 28 4月, 2012 1 次提交
  6. 19 4月, 2012 2 次提交
  7. 13 4月, 2012 1 次提交
  8. 29 3月, 2012 1 次提交
    • C
      Btrfs: flush out and clean up any block device pages during mount · 3c4bb26b
      Chris Mason 提交于
      Btrfs puts the filesystem metadata into its own address space, and
      somehow the block device address space isn't getting onto disk properly
      before a mount.  The end result is that a loop of mkfs and mounting the
      filesystem will sometimes find stale or incorrect data.
      
      This commit should fix it by sprinkling fdatawrites and invalidate_bdev
      calls around.  This is a short term measure to make sure it is fixed.
      The block devices really should be flushed and cleaned up higher in the
      stack.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      3c4bb26b
  9. 27 3月, 2012 7 次提交
  10. 22 3月, 2012 6 次提交
  11. 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
  12. 17 2月, 2012 1 次提交
  13. 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
  14. 17 1月, 2012 10 次提交
    • C
      Btrfs: use larger system chunks · 96bdc7dc
      Chris Mason 提交于
      system chunks by default are very small.  This makes them slightly
      larger and also fixes the conditional checks to make sure we don't
      allocate a billion of them at once.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      96bdc7dc
    • I
      Btrfs: add balance progress reporting · 19a39dce
      Ilya Dryomov 提交于
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      19a39dce
    • I
      Btrfs: allow for canceling restriper · a7e99c69
      Ilya Dryomov 提交于
      Implement an ioctl for canceling restriper.  Currently we wait until
      relocation of the current block group is finished, in future this can be
      done by triggering a commit.  Balance item is deleted and no memory
      about the interrupted balance is kept.
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      a7e99c69
    • I
      Btrfs: allow for pausing restriper · 837d5b6e
      Ilya Dryomov 提交于
      Implement an ioctl for pausing restriper.  This pauses the relocation,
      but balance is still considered to be "in progress": balance item is
      not deleted, other volume operations cannot be started, etc.  If paused
      in the middle of profile changing operation we will continue making
      allocations with the target profile.
      
      Add a hook to close_ctree() to pause restriper and free its data
      structures on unmount.  (It's safe to unmount when restriper is in
      "paused" state, we will resume with the same parameters on the next
      mount)
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      837d5b6e
    • I
      Btrfs: add skip_balance mount option · 9555c6c1
      Ilya Dryomov 提交于
      Since restriper kthread starts involuntarily on mount and can suck cpu
      and memory bandwidth add a mount option to forcefully skip it.  The
      restriper in that case hangs around in paused state and can be resumed
      from userspace when it's convenient.
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      9555c6c1
    • I
      Btrfs: recover balance on mount · 59641015
      Ilya Dryomov 提交于
      On mount, if balance item is found, resume balance in a separate
      kernel thread.
      
      Try to be smart to continue roughly where previous balance (or convert)
      was interrupted.  For chunk types that were being converted to some
      profile we turn on soft convert, in case of a simple balance we turn on
      usage filter and relocate only less-than-90%-full chunks of that type.
      These are just heuristics but they help quite a bit, and can be improved
      in future.
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      59641015
    • I
      Btrfs: save balance parameters to disk · 0940ebf6
      Ilya Dryomov 提交于
      Introduce a new btree objectid for storing balance item.  The reason is
      to be able to resume restriper after a crash with the same parameters.
      Balance item has a very high objectid and goes into tree of tree roots.
      
      The key for the new item is as follows:
      
      	[ BTRFS_BALANCE_OBJECTID ; BTRFS_BALANCE_ITEM_KEY ; 0 ]
      
      Older kernels simply ignore it so it's safe to mount with an older
      kernel and then go back to the newer one.
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      0940ebf6
    • I
      Btrfs: soft profile changing mode (aka soft convert) · cfa4c961
      Ilya Dryomov 提交于
      When doing convert from one profile to another if soft mode is on
      restriper won't touch chunks that already have the profile we are
      converting to.  This is useful if e.g. half of the FS was converted
      earlier.
      
      The soft mode switch is (like every other filter) per-type.  This means
      that we can convert for example meta chunks the "hard" way while
      converting data chunks selectively with soft switch.
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      cfa4c961
    • I
      Btrfs: implement online profile changing · e4d8ec0f
      Ilya Dryomov 提交于
      Profile changing is done by launching a balance with
      BTRFS_BALANCE_CONVERT bits set and target fields of respective
      btrfs_balance_args structs initialized.  Profile reducing code in this
      case will pick restriper's target profile if it's available instead of
      doing a blind reduce.  If target profile is not yet available it goes
      back to a plain reduce.
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      e4d8ec0f
    • I
      Btrfs: virtual address space subset filter · ea67176a
      Ilya Dryomov 提交于
      Select chunks which have at least one byte located inside a given
      [vstart, vend) virtual address space range.
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      ea67176a