1. 18 5月, 2013 1 次提交
    • 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
  2. 21 2月, 2013 1 次提交
    • Z
      btrfs: define BTRFS_MAGIC as a u64 value · cdb4c574
      Zach Brown 提交于
      super.magic is an le64 but it's treated as an unterminated string when
      compared against BTRFS_MAGIC which is defined as a string.  Instead
      define BTRFS_MAGIC as a normal hex value and use endian helpers to
      compare it to the super's magic.
      
      I tested this by mounting an fs made before the change and made sure
      that it didn't introduce sparse errors.  This matches a similar cleanup
      that is pending in btrfs-progs.  David Sterba pointed out that we should
      fix the kernel side as well :).
      Signed-off-by: NZach Brown <zab@redhat.com>
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      cdb4c574
  3. 17 12月, 2012 1 次提交
  4. 13 12月, 2012 3 次提交
    • S
      Btrfs: handle errors from btrfs_map_bio() everywhere · 61891923
      Stefan Behrens 提交于
      With the addition of the device replace procedure, it is possible
      for btrfs_map_bio(READ) to report an error. This happens when the
      specific mirror is requested which is located on the target disk,
      and the copy operation has not yet copied this block. Hence the
      block cannot be read and this error state is indicated by
      returning EIO.
      Some background information follows now. A new mirror is added
      while the device replace procedure is running.
      btrfs_get_num_copies() returns one more, and
      btrfs_map_bio(GET_READ_MIRROR) adds one more mirror if a disk
      location is involved that was already handled by the device
      replace copy operation. The assigned mirror num is the highest
      mirror number, e.g. the value 3 in case of RAID1.
      If btrfs_map_bio() is invoked with mirror_num == 0 (i.e., select
      any mirror), the copy on the target drive is never selected
      because that disk shall be able to perform the write requests as
      quickly as possible. The parallel execution of read requests would
      only slow down the disk copy procedure. Second case is that
      btrfs_map_bio() is called with mirror_num > 0. This is done from
      the repair code only. In this case, the highest mirror num is
      assigned to the target disk, since it is used last. And when this
      mirror is not available because the copy procedure has not yet
      handled this area, an error is returned. Everywhere in the code
      the handling of such errors is added now.
      Signed-off-by: NStefan Behrens <sbehrens@giantdisaster.de>
      Signed-off-by: NChris Mason <chris.mason@fusionio.com>
      61891923
    • S
      Btrfs: pass fs_info to btrfs_map_block() instead of mapping_tree · 3ec706c8
      Stefan Behrens 提交于
      This is required for the device replace procedure in a later step.
      Two calling functions also had to be changed to have the fs_info
      pointer: repair_io_failure() and scrub_setup_recheck_block().
      Signed-off-by: NStefan Behrens <sbehrens@giantdisaster.de>
      Signed-off-by: NChris Mason <chris.mason@fusionio.com>
      3ec706c8
    • S
      Btrfs: Pass fs_info to btrfs_num_copies() instead of mapping_tree · 5d964051
      Stefan Behrens 提交于
      This is required for the device replace procedure in a later step.
      Signed-off-by: NStefan Behrens <sbehrens@giantdisaster.de>
      Signed-off-by: NChris Mason <chris.mason@fusionio.com>
      5d964051
  5. 09 10月, 2012 1 次提交
  6. 26 7月, 2012 1 次提交
    • A
      Btrfs: introduce subvol uuids and times · 8ea05e3a
      Alexander Block 提交于
      This patch introduces uuids for subvolumes. Each
      subvolume has it's own uuid. In case it was snapshotted,
      it also contains parent_uuid. In case it was received,
      it also contains received_uuid.
      
      It also introduces subvolume ctime/otime/stime/rtime. The
      first two are comparable to the times found in inodes. otime
      is the origin/creation time and ctime is the change time.
      stime/rtime are only valid on received subvolumes.
      stime is the time of the subvolume when it was
      sent. rtime is the time of the subvolume when it was
      received.
      
      Additionally to the times, we have a transid for each
      time. They are updated at the same place as the times.
      
      btrfs receive uses stransid and rtransid to find out
      if a received subvolume changed in the meantime.
      
      If an older kernel mounts a filesystem with the
      extented fields, all fields become invalid. The next
      mount with a new kernel will detect this and reset the
      fields.
      Signed-off-by: NAlexander Block <ablock84@googlemail.com>
      Reviewed-by: NDavid Sterba <dave@jikos.cz>
      Reviewed-by: NArne Jansen <sensille@gmx.net>
      Reviewed-by: NJan Schmidt <list.btrfs@jan-o-sch.net>
      Reviewed-by: NAlex Lyakas <alex.bolshoy.btrfs@gmail.com>
      8ea05e3a
  7. 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
  8. 30 5月, 2012 2 次提交
  9. 11 5月, 2012 1 次提交
  10. 24 2月, 2012 1 次提交
  11. 10 2月, 2012 1 次提交
  12. 27 1月, 2012 1 次提交
  13. 22 12月, 2011 1 次提交