]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
md/raid1: honor REQ_NOWAIT when waiting for behind writes
authorAbd-Alrhman Masalkhi <abd.masalkhi@gmail.com>
Thu, 11 Jun 2026 08:35:14 +0000 (08:35 +0000)
committerYu Kuai <yukuai@fygo.io>
Sat, 20 Jun 2026 20:19:27 +0000 (04:19 +0800)
commita286cb88ddb26c5f4377859d8e77233d9181eb82
tree4505203530565644d992e3e82ceaaa6a2378dbcb
parent53528031e7a6e16f0f05347f3826ffb4f957b7e4
md/raid1: honor REQ_NOWAIT when waiting for behind writes

raid1 supports REQ_NOWAIT reads by avoiding waits in the barrier path
through wait_read_barrier(). However, a read can still block on a
WriteMostly device when the array uses a bitmap and there are
outstanding behind writes.

In that case raid1 unconditionally calls wait_behind_writes(), which
may sleep until all behind writes complete. As a result, a REQ_NOWAIT
read can block despite the caller explicitly requesting non-blocking
behavior.

This ensures that raid1 consistently honors REQ_NOWAIT reads across all
paths that may otherwise wait for behind writes.

Fixes: 5aa705039c4f ("md: raid1 add nowait support")
Signed-off-by: Abd-Alrhman Masalkhi <abd.masalkhi@gmail.com>
Link: https://patch.msgid.link/20260611083514.754922-1-abd.masalkhi@gmail.com
Signed-off-by: Yu Kuai <yukuai@fygo.io>
drivers/md/md-bitmap.c
drivers/md/md-bitmap.h
drivers/md/md-llbitmap.c
drivers/md/md.c
drivers/md/raid1.c