1. 22 1月, 2013 1 次提交
  2. 20 1月, 2013 1 次提交
    • I
      Btrfs: bring back balance pause/resume logic · ed0fb78f
      Ilya Dryomov 提交于
      Balance pause/resume logic got broken by 5ac00add (went in into 3.8-rc1
      as part of dev-replace merge).  Offending commit took a stab at making
      mutually exclusive volume operations (add_dev, rm_dev, resize, balance,
      replace_dev) not block behind volume_mutex if another such operation is
      in progress and instead return an error right away.  Balancing front-end
      relied on the blocking behaviour, so the fix is ugly, but short of a
      complete rework, it's the best we can do.
      Reported-by: NLiu Bo <bo.li.liu@oracle.com>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      ed0fb78f
  3. 15 1月, 2013 1 次提交
  4. 17 12月, 2012 4 次提交
    • L
      Btrfs: put raid properties into global table · 31e50229
      Liu Bo 提交于
      Raid properties can be shared among raid calculation code, we can put
      them into a global table to keep it simple.
      Signed-off-by: NLiu Bo <bo.li.liu@oracle.com>
      Signed-off-by: NChris Mason <chris.mason@fusionio.com>
      31e50229
    • J
      Btrfs: log changed inodes based on the extent map tree · 70c8a91c
      Josef Bacik 提交于
      We don't really need to copy extents from the source tree since we have all
      of the information already available to us in the extent_map tree.  So
      instead just write the extents straight to the log tree and don't bother to
      copy the extent items from the source tree.
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      Signed-off-by: NChris Mason <chris.mason@fusionio.com>
      70c8a91c
    • L
      btrfs: Notify udev when removing device · b8b8ff59
      Lukas Czerner 提交于
      Currently udev does not know about the device being removed from the
      file system. This may result in the situation where we're unable to
      mount the file system by UUID or by LABEL because the by-uuid and
      by-label links may still point to the device which is no longer part of
      the btrfs file system and hence does not have any btrfs super block.
      
      It can be easily reproduced by the following:
      
      mkfs.btrfs -L bugfs /dev/loop[0-6]
      mount /dev/loop0 /mnt/test
      btrfs device delete /dev/loop0 /mnt/test
      umount /mnt/test
      
      mount LABEL=bugfs /mnt/test <---- this fails
      
      then see:
      
      ls -l /dev/disk/by-label/bugfs
      
      which will still point to the /dev/loop0
      
      We did not noticed this before because libblkid would send the udev
      event for us when it notice that the link does not fit the reality,
      however it does not do that anymore and completely relies on udev
      information.
      
      Fix this by sending the KOBJ_CHANGE event to the bdev kobject after
      successful device removal.
      
      Note that this does not affect device addition, because we will open the
      device prior the addition from userspace and udev will notice that and
      reread the device afterwards.
      Signed-off-by: NLukas Czerner <lczerner@redhat.com>
      Signed-off-by: NChris Mason <chris.mason@fusionio.com>
      b8b8ff59
    • S
      Btrfs: fix a build warning for an unused label · f9c83748
      Stefan Behrens 提交于
      This issue was detected by the "0-DAY kernel build testing".
      
      fs/btrfs/volumes.c: In function 'btrfs_rm_device':
      fs/btrfs/volumes.c:1505:1: warning: label 'error_close' defined but not used [-Wunused-label]
      Signed-off-by: NStefan Behrens <sbehrens@giantdisaster.de>
      Signed-off-by: NChris Mason <chris.mason@fusionio.com>
      f9c83748
  5. 13 12月, 2012 20 次提交
  6. 12 12月, 2012 2 次提交
  7. 26 10月, 2012 1 次提交
    • M
      Btrfs: fix deadlock caused by the nested chunk allocation · 671415b7
      Miao Xie 提交于
      Steps to reproduce:
       # mkfs.btrfs -m raid1 <disk1> <disk2>
       # btrfstune -S 1 <disk1>
       # mount <disk1> <mnt>
       # btrfs device add <disk3> <disk4> <mnt>
       # mount -o remount,rw <mnt>
       # dd if=/dev/zero of=<mnt>/tmpfile bs=1M count=1
       Deadlock happened.
      
      It is because of the nested chunk allocation. When we wrote the data
      into the filesystem, we would allocate the data chunk because there was
      no data chunk in the filesystem. At the end of the data chunk allocation,
      we should insert the metadata of the data chunk into the extent tree, but
      there was no raid1 chunk, so we tried to lock the chunk allocation mutex to
      allocate the new chunk, but we had held the mutex, the deadlock happened.
      
      By rights, we would allocate the raid1 chunk when we added the second device
      because the profile of the seed filesystem is raid1 and we had two devices.
      But we didn't do that in fact. It is because the last step of the first device
      insertion didn't commit the transaction. So when we added the second device,
      we didn't cow the tree, and just inserted the relative metadata into the leaves
      which were generated by the first device insertion, and its profile was dup.
      
      So, I fix this problem by commiting the transaction at the end of the first
      device insertion.
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      671415b7
  8. 09 10月, 2012 3 次提交
    • S
      Btrfs: make filesystem read-only when submitting barrier fails · 5af3e8cc
      Stefan Behrens 提交于
      So far the return code of barrier_all_devices() is ignored, which
      means that errors are ignored. The result can be a corrupt
      filesystem which is not consistent.
      This commit adds code to evaluate the return code of
      barrier_all_devices(). The normal btrfs_error() mechanism is used to
      switch the filesystem into read-only mode when errors are detected.
      
      In order to decide whether barrier_all_devices() should return
      error or success, the number of disks that are allowed to fail the
      barrier submission is calculated. This calculation accounts for the
      worst RAID level of metadata, system and data. If single, dup or
      RAID0 is in use, a single disk error is already considered to be
      fatal. Otherwise a single disk error is tolerated.
      
      The calculation of the number of disks that are tolerated to fail
      the barrier operation is performed when the filesystem gets mounted,
      when a balance operation is started and finished, and when devices
      are added or removed.
      Signed-off-by: NStefan Behrens <sbehrens@giantdisaster.de>
      5af3e8cc
    • D
      btrfs: fix message printing · 48940662
      Daniel J Blueman 提交于
      Fix various messages to include newline and module prefix.
      Signed-off-by: NDaniel J Blueman <daniel@quora.org>
      48940662
    • D
      btrfs: move transaction aborts to the point of failure · 005d6427
      David Sterba 提交于
      Call btrfs_abort_transaction as early as possible when an error
      condition is detected, that way the line number reported is useful
      and we're not clueless anymore which error path led to the abort.
      Signed-off-by: NDavid Sterba <dsterba@suse.cz>
      005d6427
  9. 29 8月, 2012 3 次提交
    • S
      Btrfs: revert checksum error statistic which can cause a BUG() · 5ee0844d
      Stefan Behrens 提交于
      Commit 442a4f63 added btrfs device
      statistic counters for detected IO and checksum errors to Linux 3.5.
      The statistic part that counts checksum errors in
      end_bio_extent_readpage() can cause a BUG() in a subfunction:
      "kernel BUG at fs/btrfs/volumes.c:3762!"
      That part is reverted with the current patch.
      However, the counting of checksum errors in the scrub context remains
      active, and the counting of detected IO errors (read, write or flush
      errors) in all contexts remains active.
      
      Cc: stable <stable@vger.kernel.org> # 3.5
      Signed-off-by: NStefan Behrens <sbehrens@giantdisaster.de>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      5ee0844d
    • J
      Btrfs: barrier before waitqueue_active · 66657b31
      Josef Bacik 提交于
      We need a barrir before calling waitqueue_active otherwise we will miss
      wakeups.  So in places that do atomic_dec(); then atomic_read() use
      atomic_dec_return() which imply a memory barrier (see memory-barriers.txt)
      and then add an explicit memory barrier everywhere else that need them.
      Thanks,
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      66657b31
    • J
      Btrfs: do not strdup non existent strings · 99f5944b
      Josef Bacik 提交于
      When we close devices we add back empty devices for some reason that escapes
      me.  In the case of a missing dev we don't allocate an rcu_string for it's
      name, so check to see if the device has a name and if it doesn't don't
      bother strdup()'ing it.  Thanks,
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      99f5944b
  10. 04 8月, 2012 1 次提交
  11. 24 7月, 2012 3 次提交