Skip to content

md/raid1: skip recovery of already synced areas#248

Open
kpd-daemon[bot] wants to merge 1 commit into
md-6.16_basefrom
series/1000853=>md-6.16
Open

md/raid1: skip recovery of already synced areas#248
kpd-daemon[bot] wants to merge 1 commit into
md-6.16_basefrom
series/1000853=>md-6.16

Conversation

@kpd-daemon
Copy link
Copy Markdown

@kpd-daemon kpd-daemon Bot commented Sep 11, 2025

Pull request for series with
subject: md/raid1: skip recovery of already synced areas
version: 1
url: https://patchwork.kernel.org/project/linux-raid/list/?series=1000853

When a new disk is added during running recovery, the kernel may
restart recovery from the beginning of the device and submit write
io to ranges that have already been synchronized.

Reproduce:
  mdadm -CR /dev/md0 -l1 -n3 /dev/sda missing missing
  mdadm --add /dev/md0 /dev/sdb
  sleep 10
  cat /proc/mdstat	# partially synchronized
  mdadm --add /dev/md0 /dev/sdc
  cat /proc/mdstat	# start from 0
  iostat 1 sdb sdc	# sdb has io, too

If 'rdev->recovery_offset' is ahead of the current recovery sector,
read from that device instead of issuing a write. It prevents
unnecessary writes while still preserving the chance to back up data
if it is the last copy.

Signed-off-by: Li Nan <linan122@huawei.com>
@kpd-daemon
Copy link
Copy Markdown
Author

kpd-daemon Bot commented Sep 11, 2025

Upstream branch: c17fb54
series: https://patchwork.kernel.org/project/linux-raid/list/?series=1000853
version: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants