]> asedeno.scripts.mit.edu Git - linux.git/commit
md/raid1,raid10: silence warning about wait-within-wait
authorNeilBrown <neilb@suse.com>
Sun, 3 Dec 2017 21:21:04 +0000 (08:21 +1100)
committerShaohua Li <shli@fb.com>
Mon, 11 Dec 2017 16:52:34 +0000 (08:52 -0800)
commit474beb575c03e0e7f1a704ac428916898f81b3cd
treece5695048133b58a6166df18f40f12e23ce00d78
parentd5d885fd514fcebc9da5503c88aa0112df7514ef
md/raid1,raid10: silence warning about wait-within-wait

If you prepare_to_wait() after a previous prepare_to_wait(),
but before calling schedule(), you get warning:

  do not call blocking ops when !TASK_RUNNING; state=2

This is appropriate as it is often a bug.  The event that the
first prepare_to_wait() expects might wake up the schedule following
the second prepare_to_wait(), which could be confusing.

However if both prepare_to_wait()s are part of simple wait_event()
loops, and if the inner one is rarely called, then there is
no problem.  The inner loop is too simple to get confused by
a stray wakeup, and the outer loop won't spin unduly because the
inner doesnt affect it often.

This pattern occurs in both raid1.c and raid10.c in the use of
flush_pending_writes().

The warning can be silenced by setting current->state to TASK_RUNNING.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/raid1.c
drivers/md/raid10.c