OSDN Git Service

md: fix deadlock error in recent patch.
authorNeilBrown <neilb@suse.com>
Thu, 5 Oct 2017 05:23:16 +0000 (16:23 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Nov 2017 08:40:47 +0000 (08:40 +0000)
commit459aad50a56bfca28cc41408448d08abdd7e17ae
tree72910f5cbfeda275c07ddb876c345016a5732a96
parent55e357bc316bc3f46e96bc55415cb7d512c8db6f
md: fix deadlock error in recent patch.

commit d47c8ad261f787af22a220ffcc2d07afba809223 upstream.

A recent patch aimed to cause md_write_start() to fail (rather than
block) when the mddev was suspending, so as to avoid deadlocks.
Unfortunately the test in wait_event() was wrong, and it didn't change
behaviour at all.

We wait_event() must wait until the metadata is written OR the array is
suspending.

Fixes: cc27b0c78c79 ("md: fix deadlock between mddev_suspend() and md_write_start()")
Reported-by: Xiao Ni <xni@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/md.c