]> git.ipfire.org Git - thirdparty/kernel/stable.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>
Mon, 28 Jul 2014 15:08:19 +0000 (08:08 -0700)
commitc1d8522d46496dc14004e09289627f475e8fb245
tree344efb24d448ced835f131d057bf8c31bff741ef
parentf742278cdd7afa342898e18ad17ab2accf81c57e
Drivers: hv: hv_fcopy: fix a race condition for SMP guest

commit 2ef82d24f445e82f80e235f44eb9d1bc933e3670 upstream.

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>
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