Skip to content

Assorted minor fixes, particularly RCU protection.

NeilBrown linux-raid 1 version In review

Get series with b4
b4 am 20160602061319.2939.72280.stgit@noble

Versions newest first

  1. v1 Latest18 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18md: disconnect device from personality before trying to remove it.drivers/md/md.c+2 -02 replies
2/18md/raid1, raid10: don't recheck "Faulty" flag in read-balance.drivers/md/raid1.c drivers/md/raid10.c+0 -150 replies
3/18md/raid10: fix refounct imbalance when resyncing an array with a replacement device.drivers/md/raid10.c+1 -10 replies
4/18md/raid10: add rcu protection in raid10_status.drivers/md/raid10.c+6 -40 replies
5/18md/raid10: add rcu protection to rdev access in raid10_sync_request.drivers/md/raid10.c+72 -483 replies
6/18md/raid10: add rcu protection to rdev access during reshape.drivers/md/raid10.c+22 -80 replies
7/18md/raid10: minor code improvement in fix_read_error()drivers/md/raid10.c+1 -10 replies
8/18md/raid10: simplify print_conf a little.drivers/md/raid10.c+8 -60 replies
9/18md/raid10: stop print_conf from being too verbose.drivers/md/raid10.c+3 -14 replies
10/18md/raid1: small cleanup in raid1_end_read/write_requestdrivers/md/raid1.c+15 -200 replies
11/18md/raid1: small code cleanup in end_sync_writedrivers/md/raid1.c+4 -100 replies
12/18md/raid1: add rcu protection to rdev in fix_read_errordrivers/md/raid1.c+32 -200 replies
13/18md/raid5: add rcu protection to rdev accesses in handle_failed_sync.drivers/md/raid5.c+4 -20 replies
14/18md/raid5: add rcu protection to rdev accesses in want_replacedrivers/md/raid5.c+4 -30 replies
15/18md/raid5: add rcu protection to rdev accesses in raid5_status.drivers/md/raid5.c+6 -40 replies
16/18md/multipath: add rcu protection to rdev access in multipath_status.drivers/md/multipath.c+7 -50 replies
17/18md: be extra careful not to take a reference to a Faulty device.drivers/md/multipath.c drivers/md/raid10.c drivers/md/raid5.c+10 -20 replies
18/18md: reduce the number of synchronize_rcu() calls when multiple devices fail.drivers/md/md.c drivers/md/md.h drivers/md/multipath.c +3 more+68 -290 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [md PATCH 00/18] Assorted minor fixes, particularly RCU protection.

The 'rdev' fields in each personality's config data are often accessed under rcu_read_lock() protection to avoid races with ->hot_remove_disk() removing the rdev.

Originally this was not necessary during resync/recovery etc because ->hot_remove_disk() was only called from md_check_recovery(), and it would only make the call if there was no resync etc happening.

However we now call ->hot_remove_disk() (from remove_and_add_spares()) from other contexts, so there could be a race in the resync code.

So this patch set adds a lot of extra rcu_read_lock protection and clean up some other bits and pieces on the way.

My goal was the final patch. If you have a large raid10 array and fail half of the devices at once (e.g. unplug a rack with half of the mirrors) then synchronize_rcu() will be called once for each device, which can add up to a big delay. A single call should suffice. The final patch makes that change.

Thanks,
NeilBrown
---

NeilBrown (18):
md: disconnect device from personality before trying to remove it. md/raid1,raid10: don't recheck "Faulty" flag in read-balance. md/raid10: fix refounct imbalance when resyncing an array with a replacement device. md/raid10: add rcu protection in raid10_status.
md/raid10: add rcu protection to rdev access in raid10_sync_request. md/raid10: add rcu protection to rdev access during reshape. md/raid10: minor code improvement in fix_read_error()
md/raid10: simplify print_conf a little.
md/raid10: stop print_conf from being too verbose.
md/raid1: small cleanup in raid1_end_read/write_request
md/raid1: small code cleanup in end_sync_write
md/raid1: add rcu protection to rdev in fix_read_error
md/raid5: add rcu protection to rdev accesses in handle_failed_sync. md/raid5: add rcu protection to rdev accesses in want_replace md/raid5: add rcu protection to rdev accesses in raid5_status. md/multipath: add rcu protection to rdev access in multipath_status.
md: be extra careful not to take a reference to a Faulty device.
md: reduce the number of synchronize_rcu() calls when multiple devices fail.

 drivers/md/md.c        |   29 ++++++-
 drivers/md/md.h        |    5 +
 drivers/md/multipath.c |   29 ++++---
 drivers/md/raid1.c     |  125 ++++++++++++++--------------
 drivers/md/raid10.c    |  213 +++++++++++++++++++++++++++++-------------------
 drivers/md/raid5.c     |   41 ++++++---
 6 files changed, 264 insertions(+), 178 deletions(-)

--
Signature