]> git.baikalelectronics.ru Git - kernel.git/commit
Drivers: hv: hv_fcopy: fix a race condition for SMP guest
authorDexuan Cui <decui@microsoft.com>
Wed, 16 Jul 2014 07:00:45 +0000 (00:00 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jul 2014 01:43:10 +0000 (18:43 -0700)
commitfa13c0f913ff6818b347b89627580f5a639138a3
tree5aaeeff3d2db582b8ea75f9a7652df0e0fc6c531
parent4c7e319d04d696f160dcdb0338778a6cade6348e
Drivers: hv: hv_fcopy: fix a race condition for SMP guest

We should schedule the 5s "timer work" before starting the data transfer,
otherwise, the data transfer code may finish so fast on another
virtual cpu that when the code(fcopy_write()) trying to cancel the 5s
"timer work" can occasionally fail because the "timer work" may haven't
been scheduled yet and as a result the fcopy process will be aborted
wrongly by fcopy_work_func() in 5s.

Thank Liz Zhang <lizzha@microsoft.com> for the initial investigation
on the bug.

This addresses https://bugzilla.redhat.com/show_bug.cgi?id=1118123

Tested-by: Liz Zhang <lizzha@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/hv_fcopy.c