Skip to content

Commit 9fdfe6d

Browse files
YuKuai-huaweiliu-song-6
authored andcommitted
md/raid10: don't BUG_ON() in raise_barrier()
If raise_barrier() is called the first time in raid10_sync_request(), which means the first non-normal io is handled, raise_barrier() should wait for all dispatched normal io to be done. This ensures that normal io won't starve. However, BUG_ON() if this is broken is too aggressive. This patch replace BUG_ON() with WARN and fall back to not force. Signed-off-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Song Liu <song@kernel.org> Link: https://lore.kernel.org/r/20230310073855.1337560-4-yukuai1@huaweicloud.com
1 parent 6efddf1 commit 9fdfe6d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/md/raid10.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,9 @@ static void flush_pending_writes(struct r10conf *conf)
952952
static void raise_barrier(struct r10conf *conf, int force)
953953
{
954954
write_seqlock_irq(&conf->resync_lock);
955-
BUG_ON(force && !conf->barrier);
955+
956+
if (WARN_ON_ONCE(force && !conf->barrier))
957+
force = false;
956958

957959
/* Wait until no block IO is waiting (unless 'force') */
958960
wait_event_barrier(conf, force || !conf->nr_waiting);

0 commit comments

Comments
 (0)