1. 10 12月, 2011 6 次提交
  2. 09 12月, 2011 24 次提交
  3. 08 12月, 2011 10 次提交
    • A
      073c4603
    • L
      Btrfs: drop spin lock when memory alloc fails · 1cf4ffdb
      Liu Bo 提交于
      Drop spin lock in convert_extent_bit() when memory alloc fails,
      otherwise, it will be a deadlock.
      Signed-off-by: NLiu Bo <liubo2009@cn.fujitsu.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      1cf4ffdb
    • L
      Btrfs: check if the to-be-added device is writable · a5d16333
      Li Zefan 提交于
      If we call ioctl(BTRFS_IOC_ADD_DEV) directly, we'll succeed in adding
      a readonly device to a btrfs filesystem, and btrfs will write to
      that device, emitting kernel errors:
      
      [ 3109.833692] lost page write due to I/O error on loop2
      [ 3109.833720] lost page write due to I/O error on loop2
      ...
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      a5d16333
    • A
      Btrfs: try cluster but don't advance in search list · 274bd4fb
      Alexandre Oliva 提交于
      When we find an existing cluster, we switch to its block group as the
      current block group, possibly skipping multiple blocks in the process.
      Furthermore, under heavy contention, multiple threads may fail to
      allocate from a cluster and then release just-created clusters just to
      proceed to create new ones in a different block group.
      
      This patch tries to allocate from an existing cluster regardless of its
      block group, and doesn't switch to that group, instead proceeding to
      try to allocate a cluster from the group it was iterating before the
      attempt.
      Signed-off-by: NAlexandre Oliva <oliva@lsd.ic.unicamp.br>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      274bd4fb
    • J
      ARM: sa1100: fix build error · c564a0cb
      Jett.Zhou 提交于
      arm-eabi-4.4.3-ld:--defsym zreladdr=: syntax error
      make[2]: *** [arch/arm/boot/compressed/vmlinux] Error 1
      make[1]: *** [arch/arm/boot/compressed/vmlinux] Error 2
      make: *** [uImage] Error 2
      Signed-off-by: NHaojian Zhuang <haojian.zhuang@gmail.com>
      Signed-off-by: NJett.Zhou <jtzhou@marvell.com>
      c564a0cb
    • N
      md/raid5: never wait for bad-block acks on failed device. · 9283d8c5
      NeilBrown 提交于
      Once a device is failed we really want to completely ignore it.
      It should go away soon anyway.
      
      In particular the presence of bad blocks on it should not cause us to
      block as we won't be trying to write there anyway.
      
      So as soon as we can check if a device is Faulty, do so and pretend
      that it is already gone if it is Faulty.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      9283d8c5
    • N
      md: ensure new badblocks are handled promptly. · 8bd2f0a0
      NeilBrown 提交于
      When we mark blocks as bad we need them to be acknowledged by the
      metadata handler promptly.
      
      For an in-kernel metadata handler that was already being done.  But
      for an external metadata handler we need to alert it of the change by
      sending a notification through the sysfs file.  This adds that
      notification.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      8bd2f0a0
    • N
      md: bad blocks shouldn't cause a Blocked status on a Faulty device. · 52c64152
      NeilBrown 提交于
      Once a device is marked Faulty the badblocks - whether acknowledged or
      not - become irrelevant.  So they shouldn't cause the device to be
      marked as Blocked.
      
      Without this patch, a process might write "-blocked" to clear the
      Blocked status, but while that will correctly fail the device, it
      won't remove the apparent 'blocked' status.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      52c64152
    • N
      md: take a reference to mddev during sysfs access. · af8a2434
      NeilBrown 提交于
      
      When we are accessing an mddev via sysfs we know that the
      mddev cannot disappear because it has an embedded kobj which
      is refcounted by sysfs.
      And we also take the mddev_lock.
      However this is not enough.
      
      The final mddev_put could have been called and the
      mddev_delayed_delete is waiting for sysfs to let go so it can destroy
      the kobj and mddev.
      In this state there are a lot of changes that should not be attempted.
      
      To to guard against this we:
       - initialise mddev->all_mddevs in on last put so the state can be
         easily detected.
       - in md_attr_show and md_attr_store, check ->all_mddevs under
         all_mddevs_lock and mddev_get the mddev if it still appears to
         be active.
      
      This means that if we get to sysfs as the mddev is being deleted we
      will get -EBUSY.
      
      rdev_attr_store and rdev_attr_show are similar but already have
      sufficient protection.  They check that rdev->mddev still points to
      mddev after taking mddev_lock.  As this is cleared  before delayed
      removal which can only be requested under the mddev_lock, this
      ensure the rdev and mddev are still alive.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      af8a2434
    • N
      md: refine interpretation of "hold_active == UNTIL_IOCTL". · 1d23f178
      NeilBrown 提交于
      We like md devices to disappear when they really are not needed.
      However it is not possible to tell from the current state whether it
      is needed or not.  We can only tell from recent history of changes.
      
      In particular immediately after we create an md device it looks very
      similar to immediately after we have finished with it.
      
      So we always preserve a newly created md device until something
      significant happens.  This state is stored in 'hold_active'.
      
      The normal case is to keep it until an ioctl happens, as that will
      normally either activate it, or explicitly de-activate it.  If it
      doesn't then it was probably created by mistake and it is now time to
      get rid of it.
      
      We can also modify an array via sysfs (instead of via ioctl) and we
      currently treat any change via sysfs like an ioctl as a sign that if
      it now isn't more active, it should be destroyed.
      However this is not appropriate as changes made via sysfs are more
      gradual so we should look for a more definitive change.
      
      So this patch only clears 'hold_active' from UNTIL_IOCTL to clear when
      the array_state is changed via sysfs.  Other changes via sysfs
      are ignored.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      1d23f178