]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
md/bitmap: always wait for writes on unplug.
authorNeilBrown <neilb@suse.de>
Tue, 9 Sep 2014 04:13:51 +0000 (14:13 +1000)
committerJiri Slaby <jslaby@suse.cz>
Thu, 9 Apr 2015 12:13:37 +0000 (14:13 +0200)
commit3f1d2f15e95c422dfec90853fa687e93c6a88c9d
tree5712eba5f8e49571b5e5f24831726c62347abfa8
parentc35d584129f4dcb1ef167427475e5452e456431e
md/bitmap: always wait for writes on unplug.

commit 4b5060ddae2b03c5387321fafc089d242225697a upstream.

If two threads call bitmap_unplug at the same time, then
one might schedule all the writes, and the other might
decide that it doesn't need to wait.  But really it does.

It rarely hurts to wait when it isn't absolutely necessary,
and the current code doesn't really focus on 'absolutely necessary'
anyway.  So just wait always.

This can potentially lead to data corruption if a crash happens
at an awkward time and data was written before the bitmap was
updated.  It is very unlikely, but this should go to -stable
just to be safe.  Appropriate for any -stable.

Signed-off-by: NeilBrown <neilb@suse.de>
Cc: stable@vger.kernel.org (please delay until 3.18 is released)
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/md/bitmap.c